struct per_thread_lock {
pthread_mutex_t lock;
-} __attribute__((aligned(CACHE_LINE_SIZE))); /* cache-line aligned */
+} __attribute__((aligned(CAA_CACHE_LINE_SIZE))); /* cache-line aligned */
static struct per_thread_lock *per_thread_lock;
static inline void loop_sleep(unsigned long l)
{
while(l-- != 0)
- cpu_relax();
+ caa_cpu_relax();
}
static int verbose_mode;
static unsigned long long __thread nr_reads;
static
-unsigned long long __attribute__((aligned(CACHE_LINE_SIZE))) *tot_nr_writes;
+unsigned long long __attribute__((aligned(CAA_CACHE_LINE_SIZE))) *tot_nr_writes;
static
-unsigned long long __attribute__((aligned(CACHE_LINE_SIZE))) *tot_nr_reads;
+unsigned long long __attribute__((aligned(CAA_CACHE_LINE_SIZE))) *tot_nr_reads;
static unsigned int nr_readers;
static unsigned int nr_writers;
while (!test_go)
{
}
- smp_mb();
+ cmm_smp_mb();
for (;;) {
for (tidx = 0; tidx < nr_readers; tidx++) {
show_usage(argc, argv);
return -1;
}
- smp_mb();
+ cmm_smp_mb();
err = sscanf(argv[1], "%u", &nr_readers);
if (err != 1) {
exit(1);
}
- smp_mb();
+ cmm_smp_mb();
test_go = 1;