Use larger number pool in test
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 2 Jun 2011 13:54:04 +0000 (09:54 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 2 Jun 2011 13:54:04 +0000 (09:54 -0400)
Prior range was to stress-test collisions.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
tests/test_urcu_rbtree.c

index 1e7445d3081f53330e2430d9186e5d94a9687c4c..89e1c90e8a6eeff694d2ce97832e8692ed8fd32e 100644 (file)
@@ -358,8 +358,9 @@ void *thr_writer(void *_count)
 
                for (i = 0; i < NR_RAND; i++) {
                        node = rbtree_alloc();
-                       //key[i] = (void *)(unsigned long)(rand() % 2048);
-                       key[i] = (void *)(unsigned long)(rand() % 6);
+                       key[i] = (void *)(unsigned long)(rand() % 2048);
+                       //For more collisions
+                       //key[i] = (void *)(unsigned long)(rand() % 6);
                        node->begin = key[i];
                        node->end = (void *)((unsigned long) key[i] + 1);
                        rcu_read_lock();
@@ -550,6 +551,8 @@ int main(int argc, char **argv)
        /* Insert items looked up by readers */
        for (i = 0; i < global_items; i++) {
                node = rbtree_alloc();
+               global_key[i] = (void *)(unsigned long)(rand() % 2048);
+               //For more collisions
                global_key[i] = (void *)(unsigned long)(rand() % 6);
                node->begin = global_key[i];
                node->end = (void *)((unsigned long) global_key[i] + 1);
This page took 0.029659 seconds and 4 git commands to generate.