6#ifndef XENIUM_QUIESCENT_STATE_BASED_HPP
7#define XENIUM_QUIESCENT_STATE_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/allocation_tracker.hpp>
15#include <xenium/acquire_guard.hpp>
17namespace xenium {
namespace reclamation {
24 template <
class T,
class MarkedPtr>
28 template <
class T, std::
size_t N = 0,
class Deleter = std::default_delete<T>>
29 class enable_concurrent_ptr;
33 region_guard()
noexcept;
34 ~region_guard()
noexcept;
36 region_guard(
const region_guard&) =
delete;
37 region_guard(region_guard&&) =
delete;
38 region_guard& operator=(
const region_guard&) =
delete;
39 region_guard& operator=(region_guard&&) =
delete;
42 template <
class T, std::
size_t N = T::number_of_mark_bits>
47 static constexpr unsigned number_epochs = 3;
50 struct thread_control_block;
52 inline static std::atomic<unsigned> global_epoch;
53 inline static detail::thread_block_list<thread_control_block> global_thread_block_list;
54 static thread_data& local_thread_data();
56 ALLOCATION_TRACKING_FUNCTIONS;
59 template <
class T, std::
size_t N,
class Deleter>
60 class quiescent_state_based::enable_concurrent_ptr :
61 private detail::deletable_object_impl<T, Deleter>,
62 private detail::tracked_object<quiescent_state_based>
65 static constexpr std::size_t number_of_mark_bits =
N;
74 friend detail::deletable_object_impl<
T, Deleter>;
83 using base = detail::guard_ptr<T, MarkedPtr, guard_ptr>;
84 using Deleter =
typename T::Deleter;
98 bool acquire_if_equal(
const concurrent_ptr<
T>&
p,
106 void reclaim(Deleter
d = Deleter())
noexcept;
110#define QUIESCENT_STATE_BASED_IMPL
111#include <xenium/reclamation/impl/quiescent_state_based.hpp>
112#undef QUIESCENT_STATE_BASED_IMPL
T must be derived from enable_concurrent_ptr<T>. D is a deleter.
Definition concurrent_ptr.hpp:21
Quiescent state based reclamation.
Definition quiescent_state_based.hpp:23
Slim wrapper around std::hash with specialization for pointer types.
Definition hash.hpp:25