summaryrefslogtreecommitdiffstats
path: root/include/framework/DynamicExtension.h
diff options
context:
space:
mode:
authorDouglas Rumbaugh <dbr4@psu.edu>2023-10-30 14:47:35 -0400
committerDouglas Rumbaugh <dbr4@psu.edu>2023-10-30 14:47:35 -0400
commit32aeedbaf6584eb71126cbe92cb42e93b65d69d3 (patch)
tree644a0bad4a67e0a7598de17ebbff78d958c4cbad /include/framework/DynamicExtension.h
parent40b87b74f2bf4e93fdc9dabd6eab9175187fb63c (diff)
downloaddynamic-extension-32aeedbaf6584eb71126cbe92cb42e93b65d69d3.tar.gz
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.
Diffstat (limited to 'include/framework/DynamicExtension.h')
-rw-r--r--include/framework/DynamicExtension.h9
1 files changed, 5 insertions, 4 deletions
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())
;
/*