pthread_t can map to other things that unsigned long (e.g. pointer).
Cast it to unsigned long for debug printing and for debug delay random
value purposes.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
unsigned long tidx = (unsigned long)data;
printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
- "reader", pthread_self(), (unsigned long)gettid());
+ "reader", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
set_affinity();
tot_nr_reads[tidx] = URCU_TLS(nr_reads);
printf_verbose("thread_end %s, thread id : %lx, tid %lu\n",
- "reader", pthread_self(), (unsigned long)gettid());
+ "reader", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
return ((void*)1);
}
unsigned long wtidx = (unsigned long)data;
printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
- "writer", pthread_self(), (unsigned long)gettid());
+ "writer", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
set_affinity();
}
printf_verbose("thread_end %s, thread id : %lx, tid %lu\n",
- "writer", pthread_self(), (unsigned long)gettid());
+ "writer", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
tot_nr_writes[wtidx] = URCU_TLS(nr_writes);
return ((void*)2);
}
printf_verbose("Writer delay : %lu loops.\n", wdelay);
printf_verbose("Reader duration : %lu loops.\n", rduration);
printf_verbose("thread %-6s, thread id : %lx, tid %lu\n",
- "main", pthread_self(), (unsigned long)gettid());
+ "main", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
tid_reader = malloc(sizeof(*tid_reader) * nr_readers);
tid_writer = malloc(sizeof(*tid_writer) * nr_writers);
unsigned long tidx = (unsigned long)data;
printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
- "reader", pthread_self(), (unsigned long)gettid());
+ "reader", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
set_affinity();
tot_nr_reads[tidx] = URCU_TLS(nr_reads);
printf_verbose("thread_end %s, thread id : %lx, tid %lu\n",
- "reader", pthread_self(), (unsigned long)gettid());
+ "reader", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
return ((void*)1);
}
long tidx;
printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
- "writer", pthread_self(), (unsigned long)gettid());
+ "writer", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
set_affinity();
}
printf_verbose("thread_end %s, thread id : %lx, tid %lu\n",
- "writer", pthread_self(), (unsigned long)gettid());
+ "writer", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
tot_nr_writes[wtidx] = URCU_TLS(nr_writes);
return ((void*)2);
}
printf_verbose("Writer delay : %lu loops.\n", wdelay);
printf_verbose("Reader duration : %lu loops.\n", rduration);
printf_verbose("thread %-6s, thread id : %lx, tid %lu\n",
- "main", pthread_self(), (unsigned long)gettid());
+ "main", (unsigned long) pthread_self(), (unsigned long) gettid());
tid_reader = malloc(sizeof(*tid_reader) * nr_readers);
tid_writer = malloc(sizeof(*tid_writer) * nr_writers);
long tidx = (long)arg;
printf("thread_begin %s, thread id : %lx, tid %lu\n",
- "reader", pthread_self(), (unsigned long)gettid());
+ "reader", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
sleep(2);
time1 = caa_get_cycles();
sleep(2);
printf("thread_end %s, thread id : %lx, tid %lu\n",
- "reader", pthread_self(), (unsigned long)gettid());
+ "reader", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
return ((void*)1);
}
cycles_t time1, time2;
printf("thread_begin %s, thread id : %lx, tid %lu\n",
- "writer", pthread_self(), (unsigned long)gettid());
+ "writer", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
sleep(2);
for (i = 0; i < OUTER_WRITE_LOOP; i++) {
}
printf("thread_end %s, thread id : %lx, tid %lu\n",
- "writer", pthread_self(), (unsigned long)gettid());
+ "writer", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
return ((void*)2);
}
tid_writer = malloc(sizeof(*tid_writer) * num_write);
printf("thread %-6s, thread id : %lx, tid %lu\n",
- "main", pthread_self(), (unsigned long)gettid());
+ "main", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
per_thread_lock = malloc(sizeof(struct per_thread_lock) * NR_READ);
unsigned long long *count = _count;
printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
- "reader", pthread_self(), (unsigned long)gettid());
+ "reader", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
set_affinity();
*count = URCU_TLS(nr_reads);
printf_verbose("thread_end %s, thread id : %lx, tid %lu\n",
- "reader", pthread_self(), (unsigned long)gettid());
+ "reader", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
return ((void*)1);
}
unsigned long long *count = _count;
printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
- "writer", pthread_self(), (unsigned long)gettid());
+ "writer", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
set_affinity();
}
printf_verbose("thread_end %s, thread id : %lx, tid %lu\n",
- "writer", pthread_self(), (unsigned long)gettid());
+ "writer", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
*count = URCU_TLS(nr_writes);
return ((void*)2);
}
printf_verbose("Writer delay : %lu loops.\n", wdelay);
printf_verbose("Reader duration : %lu loops.\n", rduration);
printf_verbose("thread %-6s, thread id : %lx, tid %lu\n",
- "main", pthread_self(), (unsigned long)gettid());
+ "main", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
tid_reader = malloc(sizeof(*tid_reader) * nr_readers);
tid_writer = malloc(sizeof(*tid_writer) * nr_writers);
cycles_t time1, time2;
printf("thread_begin %s, thread id : %lx, tid %lu\n",
- "reader", pthread_self(), (unsigned long)gettid());
+ "reader", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
sleep(2);
time1 = caa_get_cycles();
sleep(2);
printf("thread_end %s, thread id : %lx, tid %lu\n",
- "reader", pthread_self(), (unsigned long)gettid());
+ "reader", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
return ((void*)1);
}
cycles_t time1, time2;
printf("thread_begin %s, thread id : %lx, tid %lu\n",
- "writer", pthread_self(), (unsigned long)gettid());
+ "writer", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
sleep(2);
for (i = 0; i < OUTER_WRITE_LOOP; i++) {
}
printf("thread_end %s, thread id : %lx, tid %lu\n",
- "writer", pthread_self(), (unsigned long)gettid());
+ "writer", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
return ((void*)2);
}
tid_writer = malloc(sizeof(*tid_writer) * num_write);
printf("thread %-6s, thread id : %lx, tid %lu\n",
- "main", pthread_self(), (unsigned long)gettid());
+ "main", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
for (i = 0; i < NR_READ; i++) {
err = pthread_create(&tid_reader[i], NULL, thr_reader,
struct test_array *local_ptr;
printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
- "reader", pthread_self(), (unsigned long)gettid());
+ "reader", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
set_affinity();
*count = URCU_TLS(nr_reads);
printf_verbose("thread_end %s, thread id : %lx, tid %lu\n",
- "reader", pthread_self(), (unsigned long)gettid());
+ "reader", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
return ((void*)1);
}
struct test_array *new, *old;
printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
- "writer", pthread_self(), (unsigned long)gettid());
+ "writer", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
set_affinity();
}
printf_verbose("thread_end %s, thread id : %lx, tid %lu\n",
- "writer", pthread_self(), (unsigned long)gettid());
+ "writer", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
*count = URCU_TLS(nr_writes);
return ((void*)2);
}
printf_verbose("Writer delay : %lu loops.\n", wdelay);
printf_verbose("Reader duration : %lu loops.\n", rduration);
printf_verbose("thread %-6s, thread id : %lx, tid %lu\n",
- "main", pthread_self(), (unsigned long)gettid());
+ "main", (unsigned long) pthread_self(),
+ (unsigned long)gettid());
test_array = calloc(1, sizeof(*test_array) * ARRAY_SIZE);
tid_reader = malloc(sizeof(*tid_reader) * nr_readers);
struct test_array *local_ptr;
printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
- "reader", pthread_self(), (unsigned long)gettid());
+ "reader", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
set_affinity();
*count = URCU_TLS(nr_reads);
printf_verbose("thread_end %s, thread id : %lx, tid %lu\n",
- "reader", pthread_self(), (unsigned long)gettid());
+ "reader", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
return ((void*)1);
}
struct test_array *new, *old;
printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
- "writer", pthread_self(), (unsigned long)gettid());
+ "writer", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
set_affinity();
}
printf_verbose("thread_end %s, thread id : %lx, tid %lu\n",
- "writer", pthread_self(), (unsigned long)gettid());
+ "writer", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
*count = URCU_TLS(nr_writes);
return ((void*)2);
}
printf_verbose("Writer delay : %lu loops.\n", wdelay);
printf_verbose("Reader duration : %lu loops.\n", rduration);
printf_verbose("thread %-6s, thread id : %lx, tid %lu\n",
- "main", pthread_self(), (unsigned long)gettid());
+ "main", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
test_array = calloc(1, sizeof(*test_array) * ARRAY_SIZE);
tid_reader = malloc(sizeof(*tid_reader) * nr_readers);
struct test_array *local_ptr;
printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
- "reader", pthread_self(), (unsigned long)gettid());
+ "reader", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
set_affinity();
*count = URCU_TLS(nr_reads);
printf_verbose("thread_end %s, thread id : %lx, tid %lu\n",
- "reader", pthread_self(), (unsigned long)gettid());
+ "reader", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
return ((void*)1);
}
struct test_array *new, *old;
printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
- "writer", pthread_self(), (unsigned long)gettid());
+ "writer", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
set_affinity();
}
printf_verbose("thread_end %s, thread id : %lx, tid %lu\n",
- "writer", pthread_self(), (unsigned long)gettid());
+ "writer", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
*count = URCU_TLS(nr_writes);
return ((void*)2);
}
printf_verbose("Writer delay : %lu loops.\n", wdelay);
printf_verbose("Reader duration : %lu loops.\n", rduration);
printf_verbose("thread %-6s, thread id : %lx, tid %lu\n",
- "main", pthread_self(), (unsigned long)gettid());
+ "main", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
test_array = calloc(1, sizeof(*test_array) * ARRAY_SIZE);
tid_reader = malloc(sizeof(*tid_reader) * nr_readers);
struct test_array *local_ptr;
printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
- "reader", pthread_self(), (unsigned long)gettid());
+ "reader", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
set_affinity();
*count = URCU_TLS(nr_reads);
printf_verbose("thread_end %s, thread id : %lx, tid %lu\n",
- "reader", pthread_self(), (unsigned long)gettid());
+ "reader", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
return ((void*)1);
}
int ret;
printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
- "writer", pthread_self(), (unsigned long)gettid());
+ "writer", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
set_affinity();
rcu_defer_unregister_thread();
printf_verbose("thread_end %s, thread id : %lx, tid %lu\n",
- "writer", pthread_self(), (unsigned long)gettid());
+ "writer", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
tot_nr_writes[wtidx] = URCU_TLS(nr_writes);
return ((void*)2);
}
printf_verbose("Writer delay : %lu loops.\n", wdelay);
printf_verbose("Reader duration : %lu loops.\n", rduration);
printf_verbose("thread %-6s, thread id : %lx, tid %lu\n",
- "main", pthread_self(), (unsigned long)gettid());
+ "main", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
tid_reader = malloc(sizeof(*tid_reader) * nr_readers);
tid_writer = malloc(sizeof(*tid_writer) * nr_writers);
struct test_array *local_ptr;
printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
- "reader", pthread_self(), (unsigned long)gettid());
+ "reader", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
set_affinity();
*count = URCU_TLS(nr_reads);
printf_verbose("thread_end %s, thread id : %lx, tid %lu\n",
- "reader", pthread_self(), (unsigned long)gettid());
+ "reader", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
return ((void*)1);
}
#endif
printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
- "writer", pthread_self(), (unsigned long)gettid());
+ "writer", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
set_affinity();
}
printf_verbose("thread_end %s, thread id : %lx, tid %lu\n",
- "writer", pthread_self(), (unsigned long)gettid());
+ "writer", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
tot_nr_writes[wtidx] = URCU_TLS(nr_writes);
return ((void*)2);
}
printf_verbose("Writer delay : %lu loops.\n", wdelay);
printf_verbose("Reader duration : %lu loops.\n", rduration);
printf_verbose("thread %-6s, thread id : %lx, tid %lu\n",
- "main", pthread_self(), (unsigned long)gettid());
+ "main", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
tid_reader = malloc(sizeof(*tid_reader) * nr_readers);
tid_writer = malloc(sizeof(*tid_writer) * nr_writers);
void *thr_count(void *arg)
{
printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
- "counter", pthread_self(), (unsigned long)gettid());
+ "counter", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
rcu_register_thread();
printf_verbose("Number of hash chains: %lu.\n",
nr_hash_chains);
printf_verbose("thread %-6s, thread id : %lx, tid %lu\n",
- "main", pthread_self(), (unsigned long)gettid());
+ "main", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
tid_reader = malloc(sizeof(*tid_reader) * nr_readers);
tid_writer = malloc(sizeof(*tid_writer) * nr_writers);
struct cds_lfht_iter iter;
printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
- "reader", pthread_self(), (unsigned long)gettid());
+ "reader", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
set_affinity();
*count = URCU_TLS(nr_reads);
printf_verbose("thread_end %s, thread id : %lx, tid %lu\n",
- "reader", pthread_self(), (unsigned long)gettid());
+ "reader", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
printf_verbose("readid : %lx, lookupfail %lu, lookupok %lu\n",
pthread_self(), URCU_TLS(lookup_fail),
URCU_TLS(lookup_ok));
int ret;
printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
- "writer", pthread_self(), (unsigned long)gettid());
+ "writer", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
set_affinity();
rcu_unregister_thread();
printf_verbose("thread_end %s, thread id : %lx, tid %lu\n",
- "writer", pthread_self(), (unsigned long)gettid());
+ "writer", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
printf_verbose("info id %lx: nr_add %lu, nr_addexist %lu, nr_del %lu, "
- "nr_delnoent %lu\n", pthread_self(), URCU_TLS(nr_add),
+ "nr_delnoent %lu\n", (unsigned long) pthread_self(), URCU_TLS(nr_add),
URCU_TLS(nr_addexist), URCU_TLS(nr_del),
URCU_TLS(nr_delnoent));
count->update_ops = URCU_TLS(nr_writes);
unsigned long long *count = _count;
printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
- "reader", pthread_self(), (unsigned long)gettid());
+ "reader", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
set_affinity();
*count = URCU_TLS(nr_reads);
printf_verbose("thread_end %s, thread id : %lx, tid %lu\n",
- "reader", pthread_self(), (unsigned long)gettid());
+ "reader", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
printf_verbose("readid : %lx, lookupfail %lu, lookupok %lu\n",
pthread_self(), URCU_TLS(lookup_fail),
URCU_TLS(lookup_ok));
int loc_add_unique;
printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
- "writer", pthread_self(), (unsigned long)gettid());
+ "writer", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
set_affinity();
rcu_unregister_thread();
printf_verbose("thread_end %s, thread id : %lx, tid %lu\n",
- "writer", pthread_self(), (unsigned long)gettid());
+ "writer", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
printf_verbose("info id %lx: nr_add %lu, nr_addexist %lu, nr_del %lu, "
- "nr_delnoent %lu\n", pthread_self(), URCU_TLS(nr_add),
+ "nr_delnoent %lu\n", (unsigned long) pthread_self(), URCU_TLS(nr_add),
URCU_TLS(nr_addexist), URCU_TLS(nr_del),
URCU_TLS(nr_delnoent));
count->update_ops = URCU_TLS(nr_writes);
unsigned long long *count = _count;
printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
- "enqueuer", pthread_self(), (unsigned long)gettid());
+ "enqueuer", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
set_affinity();
count[1] = URCU_TLS(nr_successful_enqueues);
printf_verbose("enqueuer thread_end, thread id : %lx, tid %lu, "
"enqueues %llu successful_enqueues %llu\n",
- pthread_self(), (unsigned long)gettid(),
+ pthread_self(),
+ (unsigned long) gettid(),
URCU_TLS(nr_enqueues), URCU_TLS(nr_successful_enqueues));
return ((void*)1);
int ret;
printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
- "dequeuer", pthread_self(), (unsigned long)gettid());
+ "dequeuer", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
set_affinity();
rcu_defer_unregister_thread();
printf_verbose("dequeuer thread_end, thread id : %lx, tid %lu, "
"dequeues %llu, successful_dequeues %llu\n",
- pthread_self(), (unsigned long)gettid(),
+ pthread_self(),
+ (unsigned long) gettid(),
URCU_TLS(nr_dequeues), URCU_TLS(nr_successful_dequeues));
count[0] = URCU_TLS(nr_dequeues);
count[1] = URCU_TLS(nr_successful_dequeues);
printf_verbose("Writer delay : %lu loops.\n", rduration);
printf_verbose("Reader duration : %lu loops.\n", wdelay);
printf_verbose("thread %-6s, thread id : %lx, tid %lu\n",
- "main", pthread_self(), (unsigned long)gettid());
+ "main", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
tid_enqueuer = malloc(sizeof(*tid_enqueuer) * nr_enqueuers);
tid_dequeuer = malloc(sizeof(*tid_dequeuer) * nr_dequeuers);
unsigned long long *count = _count;
printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
- "enqueuer", pthread_self(), (unsigned long)gettid());
+ "enqueuer", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
set_affinity();
count[1] = URCU_TLS(nr_successful_enqueues);
printf_verbose("enqueuer thread_end, thread id : %lx, tid %lu, "
"enqueues %llu successful_enqueues %llu\n",
- pthread_self(), (unsigned long)gettid(),
+ pthread_self(),
+ (unsigned long) gettid(),
URCU_TLS(nr_enqueues), URCU_TLS(nr_successful_enqueues));
return ((void*)1);
int ret;
printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
- "dequeuer", pthread_self(), (unsigned long)gettid());
+ "dequeuer", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
set_affinity();
printf_verbose("dequeuer thread_end, thread id : %lx, tid %lu, "
"dequeues %llu, successful_dequeues %llu\n",
- pthread_self(), (unsigned long)gettid(),
+ pthread_self(),
+ (unsigned long) gettid(),
URCU_TLS(nr_dequeues), URCU_TLS(nr_successful_dequeues));
count[0] = URCU_TLS(nr_dequeues);
count[1] = URCU_TLS(nr_successful_dequeues);
printf_verbose("Writer delay : %lu loops.\n", rduration);
printf_verbose("Reader duration : %lu loops.\n", wdelay);
printf_verbose("thread %-6s, thread id : %lx, tid %lu\n",
- "main", pthread_self(), (unsigned long)gettid());
+ "main", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
tid_enqueuer = malloc(sizeof(*tid_enqueuer) * nr_enqueuers);
tid_dequeuer = malloc(sizeof(*tid_dequeuer) * nr_dequeuers);
struct test_array *local_ptr;
printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
- "reader", pthread_self(), (unsigned long)gettid());
+ "reader", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
set_affinity();
*count = URCU_TLS(nr_reads);
printf_verbose("thread_end %s, thread id : %lx, tid %lu\n",
- "reader", pthread_self(), (unsigned long)gettid());
+ "reader", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
return ((void*)1);
}
struct test_array *new, *old;
printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
- "writer", pthread_self(), (unsigned long)gettid());
+ "writer", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
set_affinity();
}
printf_verbose("thread_end %s, thread id : %lx, tid %lu\n",
- "writer", pthread_self(), (unsigned long)gettid());
+ "writer", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
*count = URCU_TLS(nr_writes);
return ((void*)2);
}
printf_verbose("Writer delay : %lu loops.\n", wdelay);
printf_verbose("Reader duration : %lu loops.\n", rduration);
printf_verbose("thread %-6s, thread id : %lx, tid %lu\n",
- "main", pthread_self(), (unsigned long)gettid());
+ "main", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
test_array = calloc(1, sizeof(*test_array) * ARRAY_SIZE);
tid_reader = malloc(sizeof(*tid_reader) * nr_readers);
struct test_array *local_ptr;
printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
- "reader", pthread_self(), (unsigned long)gettid());
+ "reader", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
set_affinity();
*count = URCU_TLS(nr_reads);
printf_verbose("thread_end %s, thread id : %lx, tid %lu\n",
- "reader", pthread_self(), (unsigned long)gettid());
+ "reader", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
return ((void*)1);
}
#endif
printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
- "writer", pthread_self(), (unsigned long)gettid());
+ "writer", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
set_affinity();
}
printf_verbose("thread_end %s, thread id : %lx, tid %lu\n",
- "writer", pthread_self(), (unsigned long)gettid());
+ "writer", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
tot_nr_writes[wtidx] = URCU_TLS(nr_writes);
return ((void*)2);
}
printf_verbose("Writer delay : %lu loops.\n", wdelay);
printf_verbose("Reader duration : %lu loops.\n", rduration);
printf_verbose("thread %-6s, thread id : %lx, tid %lu\n",
- "main", pthread_self(), (unsigned long)gettid());
+ "main", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
tid_reader = malloc(sizeof(*tid_reader) * nr_readers);
tid_writer = malloc(sizeof(*tid_writer) * nr_writers);
cycles_t time1, time2;
printf("thread_begin %s, thread id : %lx, tid %lu\n",
- "reader", pthread_self(), (unsigned long)gettid());
+ "reader", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
sleep(2);
rcu_register_thread();
sleep(2);
printf("thread_end %s, thread id : %lx, tid %lu\n",
- "reader", pthread_self(), (unsigned long)gettid());
+ "reader", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
return ((void*)1);
}
cycles_t time1, time2;
printf("thread_begin %s, thread id : %lx, tid %lu\n",
- "writer", pthread_self(), (unsigned long)gettid());
+ "writer", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
sleep(2);
for (i = 0; i < OUTER_WRITE_LOOP; i++) {
}
printf("thread_end %s, thread id : %lx, tid %lu\n",
- "writer", pthread_self(), (unsigned long)gettid());
+ "writer", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
return ((void*)2);
}
tid_writer = malloc(sizeof(*tid_writer) * num_write);
printf("thread %-6s, thread id : %lx, tid %lu\n",
- "main", pthread_self(), (unsigned long)gettid());
+ "main", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
for (i = 0; i < NR_READ; i++) {
err = pthread_create(&tid_reader[i], NULL, thr_reader,
cycles_t time1, time2;
printf("thread_begin %s, thread id : %lx, tid %lu\n",
- "reader", pthread_self(), (unsigned long)gettid());
+ "reader", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
sleep(2);
rcu_register_thread();
sleep(2);
printf("thread_end %s, thread id : %lx, tid %lu\n",
- "reader", pthread_self(), (unsigned long)gettid());
+ "reader", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
return ((void*)1);
}
cycles_t time1, time2;
printf("thread_begin %s, thread id : %lx, tid %lu\n",
- "writer", pthread_self(), (unsigned long)gettid());
+ "writer", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
sleep(2);
for (i = 0; i < OUTER_WRITE_LOOP; i++) {
}
printf("thread_end %s, thread id : %lx, tid %lu\n",
- "writer", pthread_self(), (unsigned long)gettid());
+ "writer", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
return ((void*)2);
}
tid_writer = malloc(sizeof(*tid_writer) * num_write);
printf("thread %-6s, thread id : %lx, tid %lu\n",
- "main", pthread_self(), (unsigned long)gettid());
+ "main", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
for (i = 0; i < NR_READ; i++) {
err = pthread_create(&tid_reader[i], NULL, thr_reader,
unsigned long long *count = _count;
printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
- "enqueuer", pthread_self(), (unsigned long)gettid());
+ "enqueuer", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
set_affinity();
count[1] = URCU_TLS(nr_successful_enqueues);
printf_verbose("enqueuer thread_end, thread id : %lx, tid %lu, "
"enqueues %llu successful_enqueues %llu\n",
- pthread_self(), (unsigned long)gettid(),
+ pthread_self(),
+ (unsigned long) gettid(),
URCU_TLS(nr_enqueues), URCU_TLS(nr_successful_enqueues));
return ((void*)1);
unsigned long long *count = _count;
printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
- "dequeuer", pthread_self(), (unsigned long)gettid());
+ "dequeuer", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
set_affinity();
printf_verbose("dequeuer thread_end, thread id : %lx, tid %lu, "
"dequeues %llu, successful_dequeues %llu\n",
- pthread_self(), (unsigned long)gettid(),
+ pthread_self(),
+ (unsigned long) gettid(),
URCU_TLS(nr_dequeues), URCU_TLS(nr_successful_dequeues));
count[0] = URCU_TLS(nr_dequeues);
count[1] = URCU_TLS(nr_successful_dequeues);
printf_verbose("Writer delay : %lu loops.\n", rduration);
printf_verbose("Reader duration : %lu loops.\n", wdelay);
printf_verbose("thread %-6s, thread id : %lx, tid %lu\n",
- "main", pthread_self(), (unsigned long)gettid());
+ "main", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
tid_enqueuer = malloc(sizeof(*tid_enqueuer) * nr_enqueuers);
tid_dequeuer = malloc(sizeof(*tid_dequeuer) * nr_dequeuers);
unsigned long long *count = _count;
printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
- "enqueuer", pthread_self(), (unsigned long)gettid());
+ "enqueuer", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
set_affinity();
count[1] = URCU_TLS(nr_successful_enqueues);
printf_verbose("enqueuer thread_end, thread id : %lx, tid %lu, "
"enqueues %llu successful_enqueues %llu\n",
- pthread_self(), (unsigned long)gettid(),
+ pthread_self(),
+ (unsigned long) gettid(),
URCU_TLS(nr_enqueues), URCU_TLS(nr_successful_enqueues));
return ((void*)1);
unsigned long long *count = _count;
printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
- "dequeuer", pthread_self(), (unsigned long)gettid());
+ "dequeuer", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
set_affinity();
printf_verbose("dequeuer thread_end, thread id : %lx, tid %lu, "
"dequeues %llu, successful_dequeues %llu\n",
- pthread_self(), (unsigned long)gettid(),
+ pthread_self(),
+ (unsigned long) gettid(),
URCU_TLS(nr_dequeues), URCU_TLS(nr_successful_dequeues));
count[0] = URCU_TLS(nr_dequeues);
count[1] = URCU_TLS(nr_successful_dequeues);
printf_verbose("Writer delay : %lu loops.\n", rduration);
printf_verbose("Reader duration : %lu loops.\n", wdelay);
printf_verbose("thread %-6s, thread id : %lx, tid %lu\n",
- "main", pthread_self(), (unsigned long)gettid());
+ "main", (unsigned long) pthread_self(),
+ (unsigned long) gettid());
tid_enqueuer = malloc(sizeof(*tid_enqueuer) * nr_enqueuers);
tid_dequeuer = malloc(sizeof(*tid_dequeuer) * nr_dequeuers);
static inline void debug_yield_init(void)
{
- URCU_TLS(rand_yield) = time(NULL) ^ pthread_self();
+ URCU_TLS(rand_yield) = time(NULL) ^ (unsigned long) pthread_self();
}
#else
static inline void debug_yield_read(void)
static inline void debug_yield_init(void)
{
- URCU_TLS(rand_yield) = time(NULL) ^ pthread_self();
+ URCU_TLS(rand_yield) = time(NULL) ^ (unsigned long) pthread_self();
}
#else
static inline void debug_yield_read(void)