#include <urcu/arch.h>
#include <urcu/tls-compat.h>
-#include "cpuset.h"
#include "thread-id.h"
#include "../common/debug-yield.h"
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
unsigned long long __attribute__((aligned(CAA_CACHE_LINE_SIZE))) *tot_nr_writes;
-
-void rcu_copy_mutex_lock(void)
-{
- int ret;
- ret = pthread_mutex_lock(&rcu_copy_mutex);
- if (ret) {
- perror("Error in pthread mutex lock");
- exit(-1);
- }
-}
-
-void rcu_copy_mutex_unlock(void)
-{
- int ret;
-
- ret = pthread_mutex_unlock(&rcu_copy_mutex);
- if (ret) {
- perror("Error in pthread mutex unlock");
- exit(-1);
- }
-}
-
+static
void *thr_reader(void *_count)
{
unsigned long long *count = _count;
rcu_gc_clear_queue(wtidx);
}
+static
void *thr_writer(void *data)
{
unsigned long wtidx = (unsigned long)data;
return ((void*)2);
}
+static
void show_usage(int argc, char **argv)
{
printf("Usage : %s nr_readers nr_writers duration (s) <OPTIONS>\n",