-static cycles_t __attribute__((aligned(CACHE_LINE_SIZE))) *reader_time;
-static cycles_t __attribute__((aligned(CACHE_LINE_SIZE))) *writer_time;
+static cycles_t __attribute__((aligned(CAA_CACHE_LINE_SIZE))) *reader_time;
+static cycles_t __attribute__((aligned(CAA_CACHE_LINE_SIZE))) *writer_time;
long tidx = (long)arg;
printf("thread_begin %s, thread id : %lx, tid %lu\n",
long tidx = (long)arg;
printf("thread_begin %s, thread id : %lx, tid %lu\n",
- "reader", pthread_self(), (unsigned long)gettid());
+ "reader", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
for (i = 0; i < OUTER_READ_LOOP; i++) {
for (j = 0; j < INNER_READ_LOOP; j++) {
pthread_mutex_lock(&per_thread_lock[tidx].lock);
for (i = 0; i < OUTER_READ_LOOP; i++) {
for (j = 0; j < INNER_READ_LOOP; j++) {
pthread_mutex_lock(&per_thread_lock[tidx].lock);
reader_time[tidx] = time2 - time1;
sleep(2);
printf("thread_end %s, thread id : %lx, tid %lu\n",
reader_time[tidx] = time2 - time1;
sleep(2);
printf("thread_end %s, thread id : %lx, tid %lu\n",
- "reader", pthread_self(), (unsigned long)gettid());
+ "reader", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
cycles_t time1, time2;
printf("thread_begin %s, thread id : %lx, tid %lu\n",
cycles_t time1, time2;
printf("thread_begin %s, thread id : %lx, tid %lu\n",
- "writer", pthread_self(), (unsigned long)gettid());
+ "writer", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
writer_time[(unsigned long)arg] += time2 - time1;
usleep(1);
}
}
printf("thread_end %s, thread id : %lx, tid %lu\n",
writer_time[(unsigned long)arg] += time2 - time1;
usleep(1);
}
}
printf("thread_end %s, thread id : %lx, tid %lu\n",
- "writer", pthread_self(), (unsigned long)gettid());
+ "writer", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
tid_writer = malloc(sizeof(*tid_writer) * num_write);
printf("thread %-6s, thread id : %lx, tid %lu\n",
tid_writer = malloc(sizeof(*tid_writer) * num_write);
printf("thread %-6s, thread id : %lx, tid %lu\n",
- "main", pthread_self(), (unsigned long)gettid());
+ "main", (unsigned long) pthread_self(),
+ (unsigned long) gettid());