From 32aeedbaf6584eb71126cbe92cb42e93b65d69d3 Mon Sep 17 00:00:00 2001 From: Douglas Rumbaugh Date: Mon, 30 Oct 2023 14:47:35 -0400 Subject: Epoch/DynamicExtension: added cv to epoch retirement check Instead of busy waiting on the active job count, a condition variable is now used to wait for all active jobs to finish before freeing an epoch's resources. --- include/framework/DynamicExtension.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'include/framework/DynamicExtension.h') diff --git a/include/framework/DynamicExtension.h b/include/framework/DynamicExtension.h index eb78d48..21d0261 100644 --- a/include/framework/DynamicExtension.h +++ b/include/framework/DynamicExtension.h @@ -79,6 +79,8 @@ public: } int erase(const R &rec) { + // FIXME: delete tagging will require a lot of extra work to get + // operating "correctly" in a concurrent environment. if constexpr (D == DeletePolicy::TAGGING) { BufView buffers = get_active_epoch()->get_buffer_view(); @@ -118,6 +120,7 @@ public: epoch->start_job(); auto t = epoch->get_buffer_view().get_tombstone_count() + epoch->get_structure()->get_tombstone_count(); epoch->end_job(); + return t; } @@ -271,11 +274,9 @@ private: * accumulate new active jobs. Eventually, this * number will hit zero and the function will * proceed. - * - * FIXME: this can be replaced with a cv, which - * is probably a superior solution in this case */ - while (epoch->get_active_job_num() > 0) + + while (!epoch->retirable()) ; /* -- cgit v1.2.3