xenium
List of all members
xenium::reclamation::he_allocation::dynamic_strategy< K, A, B > Struct Template Reference

Hazard era allocation strategy for a dynamic number of hazard eras per thread. More...

#include <hazard_eras.hpp>

Inherits xenium::reclamation::detail::generic_hazard_era_allocation_strategy< K_, A, B, ThreadControlBlock >.

Detailed Description

template<size_t K = 2, size_t A = 2, size_t B = 100>
struct xenium::reclamation::he_allocation::dynamic_strategy< K, A, B >

Hazard era allocation strategy for a dynamic number of hazard eras per thread.

This strategy uses a linked list of segments for the hazard eras. The first segment can hold K hazard eras; subsequently allocated segments can hold 1.5x the number of hazard eras as the sum of all previous segments.

The threshold for the number of retired nodes is calculated as A * available_hes + B, where available_hes is the max. number of hazard eras that could be allocated by all threads at that time, without growing the number of segments. E.g., if K = 2 and we have two threads each with a single segment, then available_hes = 4; if one thread later allocates additional hes and increases the number of segments such that they can hold up to 10 hazard eras, then available_hes = 10+2 = 12.

K, A and B can be configured via template parameter.

Template Parameters
KThe initial number of hazard eras (i.e., the number of hes that can be allocated without the need to grow).
A
B