update test timings for writer
authorMathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Mon, 8 Jun 2009 18:12:50 +0000 (14:12 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Mon, 8 Jun 2009 18:12:50 +0000 (14:12 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
test_perthreadlock_timing.c
test_urcu_timing.c

index 5369796759bfa950108117c5d4a864ca6aa06721..479895ee1b32f978f02f8cb04774244da0784fec 100644 (file)
@@ -127,8 +127,8 @@ void *thr_writer(void *arg)
                        }
                        time2 = get_cycles();
                        writer_time[(unsigned long)arg] += time2 - time1;
+                       usleep(1);
                }
-               usleep(1);
        }
 
        printf("thread_end %s, thread id : %lx, tid %lu\n",
index 5065891a50af55b7bb10e9d1a788020f19a3bbbd..6b4aac8b12de0aeaf2f317c6408cc19d37be7d74 100644 (file)
@@ -140,8 +140,8 @@ void *thr_writer(void *arg)
        sleep(2);
 
        for (i = 0; i < OUTER_WRITE_LOOP; i++) {
-               time1 = get_cycles();
                for (j = 0; j < INNER_WRITE_LOOP; j++) {
+                       time1 = get_cycles();
                        new = malloc(sizeof(struct test_array));
                        rcu_copy_mutex_lock();
                        old = test_rcu_pointer;
@@ -156,10 +156,10 @@ void *thr_writer(void *arg)
                                old->a = 0;
                        }
                        free(old);
+                       time2 = get_cycles();
+                       writer_time[(unsigned long)arg] += time2 - time1;
+                       usleep(1);
                }
-               time2 = get_cycles();
-               writer_time[(unsigned long)arg] += time2 - time1;
-               usleep(1);
        }
 
        printf("thread_end %s, thread id : %lx, tid %lu\n",
This page took 0.025468 seconds and 4 git commands to generate.