/* write-side C.S. duration, in loops */
static unsigned long wduration;
/* write-side C.S. duration, in loops */
static unsigned long wduration;
-static unsigned long long __thread nr_writes;
-static unsigned long long __thread nr_reads;
+static DEFINE_URCU_TLS(unsigned long long, nr_writes);
+static DEFINE_URCU_TLS(unsigned long long, nr_reads);
printf_verbose("thread_end %s, thread id : %lx, tid %lu\n",
"reader", pthread_self(), (unsigned long)gettid());
return ((void*)1);
printf_verbose("thread_end %s, thread id : %lx, tid %lu\n",
"reader", pthread_self(), (unsigned long)gettid());
return ((void*)1);
loop_sleep(wduration);
for (tidx = (long)nr_readers - 1; tidx >= 0; tidx--) {
pthread_mutex_unlock(&per_thread_lock[tidx].lock);
}
loop_sleep(wduration);
for (tidx = (long)nr_readers - 1; tidx >= 0; tidx--) {
pthread_mutex_unlock(&per_thread_lock[tidx].lock);
}
loop_sleep(wdelay);
}
printf_verbose("thread_end %s, thread id : %lx, tid %lu\n",
"writer", pthread_self(), (unsigned long)gettid());
loop_sleep(wdelay);
}
printf_verbose("thread_end %s, thread id : %lx, tid %lu\n",
"writer", pthread_self(), (unsigned long)gettid());
tid_reader = malloc(sizeof(*tid_reader) * nr_readers);
tid_writer = malloc(sizeof(*tid_writer) * nr_writers);
tid_reader = malloc(sizeof(*tid_reader) * nr_readers);
tid_writer = malloc(sizeof(*tid_writer) * nr_writers);
tot_nr_reads = malloc(sizeof(*tot_nr_reads) * nr_readers);
tot_nr_writes = malloc(sizeof(*tot_nr_writes) * nr_writers);
per_thread_lock = malloc(sizeof(*per_thread_lock) * nr_readers);
tot_nr_reads = malloc(sizeof(*tot_nr_reads) * nr_readers);
tot_nr_writes = malloc(sizeof(*tot_nr_writes) * nr_writers);
per_thread_lock = malloc(sizeof(*per_thread_lock) * nr_readers);