From: Mathieu Desnoyers Date: Mon, 8 Jun 2009 18:12:50 +0000 (-0400) Subject: update test timings for writer X-Git-Tag: v0.1~192 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=fc606a745f2825aff6c615e5d6703526e170906b;p=userspace-rcu.git update test timings for writer Signed-off-by: Mathieu Desnoyers --- diff --git a/test_perthreadlock_timing.c b/test_perthreadlock_timing.c index 5369796..479895e 100644 --- a/test_perthreadlock_timing.c +++ b/test_perthreadlock_timing.c @@ -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", diff --git a/test_urcu_timing.c b/test_urcu_timing.c index 5065891..6b4aac8 100644 --- a/test_urcu_timing.c +++ b/test_urcu_timing.c @@ -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",