rculfhash: benchmark QSBR flavor
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Sat, 3 Sep 2011 19:24:25 +0000 (15:24 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Sat, 3 Sep 2011 19:24:25 +0000 (15:24 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
tests/Makefile.am
tests/test_urcu_hash.c

index d32088b8e2cade6aa5a79eb16feb715c6d6615f0..9e5940f749b8e335961785a556b4de1d1a2d8772 100644 (file)
@@ -176,8 +176,8 @@ test_urcu_wfs_dynlink_CFLAGS = -DDYNAMIC_LINK_TEST $(AM_CFLAGS)
 test_urcu_wfs_dynlink_LDADD = $(URCU_COMMON_LIB)
 
 test_urcu_hash_SOURCES = test_urcu_hash.c $(COMPAT)
-test_urcu_hash_CFLAGS = -DRCU_MEMBARRIER $(AM_CFLAGS)
-test_urcu_hash_LDADD = $(URCU) $(URCU_CDS_LIB)
+test_urcu_hash_CFLAGS = -DRCU_QSBR $(AM_CFLAGS)
+test_urcu_hash_LDADD = $(URCU_QSBR_LIB) $(URCU_CDS_LIB)
 
 urcutorture.c: api.h
 
index be0eaf4f6e746864ff8093503999cb1304144016..ffd8e2f774111625be67d5698caef5216fe11dde 100644 (file)
@@ -66,7 +66,7 @@ static inline pid_t gettid(void)
 #else
 #define debug_yield_read()
 #endif
-#include <urcu.h>
+#include <urcu-qsbr.h>
 #include <urcu/rculfhash.h>
 #include <urcu-call-rcu.h>
 
@@ -369,6 +369,8 @@ void *thr_reader(void *_count)
                nr_reads++;
                if (unlikely(!test_duration_read()))
                        break;
+               if (unlikely((nr_reads & ((1 << 10) - 1)) == 0))
+                       rcu_quiescent_state();
        }
 
        rcu_unregister_thread();
@@ -459,6 +461,8 @@ void *thr_writer(void *_count)
                        break;
                if (unlikely(wdelay))
                        loop_sleep(wdelay);
+               if (unlikely((nr_writes & ((1 << 10) - 1)) == 0))
+                       rcu_quiescent_state();
        }
 
        rcu_unregister_thread();
This page took 0.028042 seconds and 4 git commands to generate.