*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
-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;
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",
- "reader", pthread_self(), (unsigned long)gettid());
+ "reader", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
sleep(2);
printf("thread_end %s, thread id : %lx, tid %lu\n",
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());
for (i = 0; i < NR_READ; i++) {
err = pthread_create(&tid_reader[i], NULL, thr_reader,
for (i = 0; i < NR_READ; i++) {
err = pthread_create(&tid_reader[i], NULL, thr_reader,