printf("running test for %lu seconds, %u readers, %u writers.\n",
duration, nr_readers, nr_writers);
printf("Writer delay : %u us.\n", wdelay);
printf("running test for %lu seconds, %u readers, %u writers.\n",
duration, nr_readers, nr_writers);
printf("Writer delay : %u us.\n", wdelay);
printf("thread %-6s, thread id : %lx, tid %lu\n",
"main", pthread_self(), (unsigned long)gettid());
printf("thread %-6s, thread id : %lx, tid %lu\n",
"main", pthread_self(), (unsigned long)gettid());
for (i = 0; i < nr_readers; i++) {
err = pthread_join(tid_reader[i], &tret);
if (err != 0)
for (i = 0; i < nr_readers; i++) {
err = pthread_join(tid_reader[i], &tret);
if (err != 0)