6#ifndef XENIUM_GENERIC_EPOCH_BASED_HPP
7#define XENIUM_GENERIC_EPOCH_BASED_HPP
9#include <xenium/reclamation/detail/concurrent_ptr.hpp>
10#include <xenium/reclamation/detail/guard_ptr.hpp>
11#include <xenium/reclamation/detail/deletable_object.hpp>
12#include <xenium/reclamation/detail/thread_block_list.hpp>
13#include <xenium/reclamation/detail/retire_list.hpp>
14#include <xenium/reclamation/detail/allocation_tracker.hpp>
15#include <xenium/acquire_guard.hpp>
16#include <xenium/parameter.hpp>
22namespace reclamation {
52 template <
size_t Threshold>
59 enum class region_extension {
116 template <
class T>
struct scan;
165namespace reclamation {
172 struct generic_epoch_based_traits {
179 using with = generic_epoch_based_traits<
238 template <
class Traits =
generic_epoch_based_traits<>>
241 template <
class T,
class MarkedPtr>
244 template <
unsigned N>
262 template <
class T, std::
size_t N = 0,
class Deleter = std::default_delete<T>>
263 class enable_concurrent_ptr;
271 region_guard(region_guard&&) =
delete;
281 using epoch_t =
size_t;
286 struct thread_control_block;
289 inline static detail::thread_block_list<thread_control_block> global_thread_block_list;
293 ALLOCATION_TRACKING_FUNCTIONS;
299 private detail::deletable_object_impl<
T, Deleter>,
303 static constexpr std::size_t number_of_mark_bits =
N;
312 friend detail::deletable_object_impl<
T, Deleter>;
322 using base = detail::guard_ptr<T, MarkedPtr, guard_ptr>;
323 using Deleter =
typename T::Deleter;
345 void reclaim(Deleter
d = Deleter())
noexcept;
349#define GENERIC_EPOCH_BASED_IMPL
350#include "impl/generic_epoch_based.hpp"
351#undef GENERIC_EPOCH_BASED_IMPL
353namespace xenium {
namespace reclamation {
T must be derived from enable_concurrent_ptr<T>. D is a deleter.
Definition concurrent_ptr.hpp:21
A generalized implementation of epoch based reclamation.
Definition generic_epoch_based.hpp:240
Slim wrapper around std::hash with specialization for pointer types.
Definition hash.hpp:25
Policy to configure the abandon strategy for generic_epoch_based reclamation.
Definition generic_epoch_based.hpp:139
Policy to configure the hash function.
Definition policy.hpp:86
Policy to configure the extension of critical regions in generic_epoch_based reclamation.
Definition generic_epoch_based.hpp:162
Policy to configure the scan frequency for generic_epoch_based reclamation.
Definition generic_epoch_based.hpp:96
Policy to configure the scan strategy for generic_epoch_based reclamation.
Definition generic_epoch_based.hpp:116
Always abandon the remaining retired nodes when the thread leaves its critical region.
Definition generic_epoch_based.hpp:99
Never abandon any nodes (except when the thread terminates).
Definition generic_epoch_based.hpp:90
Abandon the retired nodes upon leaving the critical region when the number of nodes exceeds the speci...
Definition generic_epoch_based.hpp:113
Scan all threads (default behaviour in EBR/NEBR).
Definition generic_epoch_based.hpp:23
Scan N threads.
Definition generic_epoch_based.hpp:49
Scan a single thread (default behaviour in DEBRA).
Definition generic_epoch_based.hpp:80