From 64ac40ab64d92e826b7f63bf82dea7f823f41e04 Mon Sep 17 00:00:00 2001 From: Samy Al Bahra Date: Wed, 15 Mar 2017 00:28:24 -0400 Subject: [PATCH] ck_epoch: there is no need to update record epoch for synchronize. This is in preparation for upcoming work for allowing record sharing. The write-side operations rely only on global state. Future work, we can play tricks by caching latest call epoch while still building on the core EBR concept. --- src/ck_epoch.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/ck_epoch.c b/src/ck_epoch.c index a0e9180..69ba6e0 100644 --- a/src/ck_epoch.c +++ b/src/ck_epoch.c @@ -481,7 +481,6 @@ reload: * semantics are necessary. */ ck_pr_fence_memory(); - record->epoch = delta; return; } @@ -509,7 +508,6 @@ ck_epoch_poll(struct ck_epoch_record *record) { bool active; unsigned int epoch; - unsigned int snapshot; struct ck_epoch_record *cr = NULL; struct ck_epoch *global = record->global; @@ -533,12 +531,7 @@ ck_epoch_poll(struct ck_epoch_record *record) } /* If an active thread exists, rely on epoch observation. */ - if (ck_pr_cas_uint_value(&global->epoch, epoch, epoch + 1, - &snapshot) == false) { - record->epoch = snapshot; - } else { - record->epoch = epoch + 1; - } + (void)ck_pr_cas_uint(&global->epoch, epoch, epoch + 1); ck_epoch_dispatch(record, epoch + 1); return true;