|
|
@ -109,7 +109,7 @@ ht_free(void *p, size_t b, bool r)
|
|
|
|
|
|
|
|
|
|
|
|
if (r == true) {
|
|
|
|
if (r == true) {
|
|
|
|
/* Destruction requires safe memory reclamation. */
|
|
|
|
/* Destruction requires safe memory reclamation. */
|
|
|
|
ck_epoch_call(&epoch_ht, &epoch_wr, &(--e)->epoch_entry, ht_destroy);
|
|
|
|
ck_epoch_call(&epoch_wr, &(--e)->epoch_entry, ht_destroy);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
free(--e);
|
|
|
|
free(--e);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -224,7 +224,7 @@ reader(void *unused)
|
|
|
|
ck_epoch_register(&epoch_ht, &epoch_record);
|
|
|
|
ck_epoch_register(&epoch_ht, &epoch_record);
|
|
|
|
for (;;) {
|
|
|
|
for (;;) {
|
|
|
|
j++;
|
|
|
|
j++;
|
|
|
|
ck_epoch_begin(&epoch_ht, &epoch_record);
|
|
|
|
ck_epoch_begin(&epoch_record);
|
|
|
|
s = rdtsc();
|
|
|
|
s = rdtsc();
|
|
|
|
for (i = 0; i < keys_length; i++) {
|
|
|
|
for (i = 0; i < keys_length; i++) {
|
|
|
|
char *r;
|
|
|
|
char *r;
|
|
|
@ -242,7 +242,7 @@ reader(void *unused)
|
|
|
|
ck_error("ERROR: Found invalid value: [%s] but expected [%s]\n", r, keys[i]);
|
|
|
|
ck_error("ERROR: Found invalid value: [%s] but expected [%s]\n", r, keys[i]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
a += rdtsc() - s;
|
|
|
|
a += rdtsc() - s;
|
|
|
|
ck_epoch_end(&epoch_ht, &epoch_record);
|
|
|
|
ck_epoch_end(&epoch_record);
|
|
|
|
|
|
|
|
|
|
|
|
n_state = ck_pr_load_int(&state);
|
|
|
|
n_state = ck_pr_load_int(&state);
|
|
|
|
if (n_state != state_previous) {
|
|
|
|
if (n_state != state_previous) {
|
|
|
@ -424,7 +424,7 @@ main(int argc, char *argv[])
|
|
|
|
fprintf(stderr, "done (%" PRIu64 " ticks)\n", a / (r * keys_length));
|
|
|
|
fprintf(stderr, "done (%" PRIu64 " ticks)\n", a / (r * keys_length));
|
|
|
|
|
|
|
|
|
|
|
|
ck_epoch_record_t epoch_temporary = epoch_wr;
|
|
|
|
ck_epoch_record_t epoch_temporary = epoch_wr;
|
|
|
|
ck_epoch_synchronize(&epoch_ht, &epoch_wr);
|
|
|
|
ck_epoch_synchronize(&epoch_wr);
|
|
|
|
|
|
|
|
|
|
|
|
fprintf(stderr, " '- Summary: %u pending, %u peak, %lu reclamations -> "
|
|
|
|
fprintf(stderr, " '- Summary: %u pending, %u peak, %lu reclamations -> "
|
|
|
|
"%u pending, %u peak, %lu reclamations\n\n",
|
|
|
|
"%u pending, %u peak, %lu reclamations\n\n",
|
|
|
@ -469,7 +469,7 @@ main(int argc, char *argv[])
|
|
|
|
while (ck_pr_load_int(&barrier[HT_STATE_STRICT_REPLACEMENT]) != n_threads)
|
|
|
|
while (ck_pr_load_int(&barrier[HT_STATE_STRICT_REPLACEMENT]) != n_threads)
|
|
|
|
ck_pr_stall();
|
|
|
|
ck_pr_stall();
|
|
|
|
table_reset();
|
|
|
|
table_reset();
|
|
|
|
ck_epoch_synchronize(&epoch_ht, &epoch_wr);
|
|
|
|
ck_epoch_synchronize(&epoch_wr);
|
|
|
|
fprintf(stderr, "done (writer = %" PRIu64 " ticks, reader = %" PRIu64 " ticks)\n",
|
|
|
|
fprintf(stderr, "done (writer = %" PRIu64 " ticks, reader = %" PRIu64 " ticks)\n",
|
|
|
|
a / (repeated * keys_length), accumulator[HT_STATE_STRICT_REPLACEMENT] / n_threads);
|
|
|
|
a / (repeated * keys_length), accumulator[HT_STATE_STRICT_REPLACEMENT] / n_threads);
|
|
|
|
|
|
|
|
|
|
|
@ -504,7 +504,7 @@ main(int argc, char *argv[])
|
|
|
|
ck_pr_stall();
|
|
|
|
ck_pr_stall();
|
|
|
|
|
|
|
|
|
|
|
|
table_reset();
|
|
|
|
table_reset();
|
|
|
|
ck_epoch_synchronize(&epoch_ht, &epoch_wr);
|
|
|
|
ck_epoch_synchronize(&epoch_wr);
|
|
|
|
fprintf(stderr, "done (writer = %" PRIu64 " ticks, reader = %" PRIu64 " ticks)\n",
|
|
|
|
fprintf(stderr, "done (writer = %" PRIu64 " ticks, reader = %" PRIu64 " ticks)\n",
|
|
|
|
a / (repeated * keys_length), accumulator[HT_STATE_DELETION] / n_threads);
|
|
|
|
a / (repeated * keys_length), accumulator[HT_STATE_DELETION] / n_threads);
|
|
|
|
|
|
|
|
|
|
|
@ -543,13 +543,13 @@ main(int argc, char *argv[])
|
|
|
|
while (ck_pr_load_int(&barrier[HT_STATE_REPLACEMENT]) != n_threads)
|
|
|
|
while (ck_pr_load_int(&barrier[HT_STATE_REPLACEMENT]) != n_threads)
|
|
|
|
ck_pr_stall();
|
|
|
|
ck_pr_stall();
|
|
|
|
table_reset();
|
|
|
|
table_reset();
|
|
|
|
ck_epoch_synchronize(&epoch_ht, &epoch_wr);
|
|
|
|
ck_epoch_synchronize(&epoch_wr);
|
|
|
|
fprintf(stderr, "done (writer = %" PRIu64 " ticks, reader = %" PRIu64 " ticks)\n",
|
|
|
|
fprintf(stderr, "done (writer = %" PRIu64 " ticks, reader = %" PRIu64 " ticks)\n",
|
|
|
|
a / (repeated * keys_length), accumulator[HT_STATE_REPLACEMENT] / n_threads);
|
|
|
|
a / (repeated * keys_length), accumulator[HT_STATE_REPLACEMENT] / n_threads);
|
|
|
|
|
|
|
|
|
|
|
|
ck_pr_inc_int(&barrier[HT_STATE_REPLACEMENT]);
|
|
|
|
ck_pr_inc_int(&barrier[HT_STATE_REPLACEMENT]);
|
|
|
|
epoch_temporary = epoch_wr;
|
|
|
|
epoch_temporary = epoch_wr;
|
|
|
|
ck_epoch_synchronize(&epoch_ht, &epoch_wr);
|
|
|
|
ck_epoch_synchronize(&epoch_wr);
|
|
|
|
|
|
|
|
|
|
|
|
fprintf(stderr, " '- Summary: %u pending, %u peak, %lu reclamations -> "
|
|
|
|
fprintf(stderr, " '- Summary: %u pending, %u peak, %lu reclamations -> "
|
|
|
|
"%u pending, %u peak, %lu reclamations\n\n",
|
|
|
|
"%u pending, %u peak, %lu reclamations\n\n",
|
|
|
|