- for (i = 0; i < WRITE_LOOP; i++) {
- new = malloc(sizeof(struct test_array));
- rcu_copy_mutex_lock();
- old = test_rcu_pointer;
- if (old) {
- assert(old->a == 8);
- }
- new->a = 8;
- old = rcu_publish_content(&test_rcu_pointer, new);
- rcu_copy_mutex_unlock();
- /* can be done after unlock */
- if (old) {
- old->a = 0;
+ for (i = 0; i < OUTER_WRITE_LOOP; i++) {
+ time1 = get_cycles();
+ for (j = 0; j < INNER_WRITE_LOOP; j++) {
+ new = malloc(sizeof(struct test_array));
+ rcu_copy_mutex_lock();
+ old = test_rcu_pointer;
+ if (old) {
+ assert(old->a == 8);
+ }
+ new->a = 8;
+ old = rcu_publish_content(&test_rcu_pointer, new);
+ rcu_copy_mutex_unlock();
+ /* can be done after unlock */
+ if (old) {
+ old->a = 0;
+ }
+ free(old);