#else
#define debug_yield_read()
#endif
-#include <urcu.h>
+#include <urcu-qsbr.h>
#include <urcu/rculfhash.h>
#include <urcu-call-rcu.h>
struct wr_count {
unsigned long update_ops;
unsigned long add;
+ unsigned long add_exist;
unsigned long remove;
};
nr_reads++;
if (unlikely(!test_duration_read()))
break;
+ if (unlikely((nr_reads & ((1 << 10) - 1)) == 0))
+ rcu_quiescent_state();
}
rcu_unregister_thread();
break;
if (unlikely(wdelay))
loop_sleep(wdelay);
+ if (unlikely((nr_writes & ((1 << 10) - 1)) == 0))
+ rcu_quiescent_state();
}
rcu_unregister_thread();
nr_addexist, nr_del, nr_delnoent);
count->update_ops = nr_writes;
count->add = nr_add;
+ count->add_exist = nr_addexist;
count->remove = nr_del;
return ((void*)2);
}
unsigned long long *count_reader;
struct wr_count *count_writer;
unsigned long long tot_reads = 0, tot_writes = 0,
- tot_add = 0, tot_remove = 0;
+ tot_add = 0, tot_add_exist = 0, tot_remove = 0;
unsigned long count, removed;
int i, a, ret;
exit(1);
tot_writes += count_writer[i].update_ops;
tot_add += count_writer[i].add;
+ tot_add_exist += count_writer[i].add_exist;
tot_remove += count_writer[i].remove;
}
printf("Counting nodes... ");
printf("SUMMARY %-25s testdur %4lu nr_readers %3u rdur %6lu "
"nr_writers %3u "
"wdelay %6lu rand_pool %12llu nr_reads %12llu nr_writes %12llu nr_ops %12llu "
- "nr_add %12llu nr_remove %12llu nr_leaked %12llu\n",
+ "nr_add %12llu nr_add_fail %12llu nr_remove %12llu nr_leaked %12llu\n",
argv[0], duration, nr_readers, rduration,
nr_writers, wdelay, rand_pool, tot_reads, tot_writes,
- tot_reads + tot_writes, tot_add, tot_remove,
+ tot_reads + tot_writes, tot_add, tot_add_exist, tot_remove,
tot_add - tot_remove - count);
free(tid_reader);
free(tid_writer);