*
* 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
/* read-side C.S. duration, in loops */
static unsigned long rduration;
/* read-side C.S. duration, in loops */
static unsigned long rduration;
-static inline void loop_sleep(unsigned long l)
+/* write-side C.S. duration, in loops */
+static unsigned long wduration;
+
+static inline void loop_sleep(unsigned long loops)
-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(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());
#endif
printf(" [-d delay] (writer period (us))");
printf(" [-c duration] (reader C.S. duration (in loops))");
#endif
printf(" [-d delay] (writer period (us))");
printf(" [-c duration] (reader C.S. duration (in loops))");
printf_verbose("total number of reads : %llu, writes %llu\n", tot_reads,
tot_writes);
printf_verbose("total number of reads : %llu, writes %llu\n", tot_reads,
tot_writes);
- argv[0], duration, nr_readers, rduration,
+ argv[0], duration, nr_readers, rduration, wduration,
nr_writers, wdelay, tot_reads, tot_writes,
tot_reads + tot_writes);
nr_writers, wdelay, tot_reads, tot_writes,
tot_reads + tot_writes);