#include <urcu/arch.h>
#include <urcu/tls-compat.h>
-#include "cpuset.h"
#include "thread-id.h"
/* hardcoded number of CPUs */
}
CPU_ZERO(&mask);
CPU_SET(cpu, &mask);
-#if SCHED_SETAFFINITY_ARGS == 2
- sched_setaffinity(0, &mask);
-#else
sched_setaffinity(0, sizeof(mask), &mask);
-#endif
#endif /* HAVE_SCHED_SETAFFINITY */
}
}
}
+static
void *thr_reader(void *data)
{
unsigned long tidx = (unsigned long)data;
}
+static
void *thr_writer(void *data)
{
unsigned long wtidx = (unsigned long)data;
cmm_smp_mb();
for (;;) {
- for (tidx = 0; tidx < nr_readers; tidx++) {
+ for (tidx = 0; tidx < (long)nr_readers; tidx++) {
urcu_mutex_lock(&per_thread_lock[tidx].lock);
}
test_array.a = 0;
return ((void*)2);
}
+static
void show_usage(int argc, char **argv)
{
printf("Usage : %s nr_readers nr_writers duration (s) <OPTIONS>\n",