From ad5e00cfb9105d7c9a6b79a59580b1075fbf06e5 Mon Sep 17 00:00:00 2001 From: Samy Al Bahra Date: Thu, 2 Jan 2014 09:11:36 -0500 Subject: [PATCH] ck_epoch: Read-side latency improvements on x86. --- include/ck_epoch.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/ck_epoch.h b/include/ck_epoch.h index 277f9fb..9de8780 100644 --- a/include/ck_epoch.h +++ b/include/ck_epoch.h @@ -100,8 +100,15 @@ ck_epoch_begin(ck_epoch_t *epoch, ck_epoch_record_t *record) * For this reason, store to load serialization is necessary. */ ck_pr_store_uint(&record->epoch, g_epoch); + +#if defined(__x86__) || defined(__x86_64__) + ck_pr_fas_uint(&record->active, 1); + ck_pr_fence_atomic_load(); +#else ck_pr_store_uint(&record->active, 1); ck_pr_fence_store_load(); +#endif + return; }