Thread System 0.3.1
High-performance C++20 thread pool with work stealing and DAG scheduling
Loading...
Searching...
No Matches
kcenon::thread::detail::thread_hazard_list Struct Reference

Thread-local hazard pointer list Each thread maintains a small array of hazard pointers. More...

#include <hazard_pointer.h>

Collaboration diagram for kcenon::thread::detail::thread_hazard_list:
Collaboration graph

Public Member Functions

 thread_hazard_list ()
 

Public Attributes

std::atomic< void * > hazards [MAX_HAZARDS_PER_THREAD]
 
thread_hazard_listnext
 
std::atomic< bool > active
 

Static Public Attributes

static constexpr size_t MAX_HAZARDS_PER_THREAD = 8
 

Detailed Description

Thread-local hazard pointer list Each thread maintains a small array of hazard pointers.

Definition at line 32 of file hazard_pointer.h.

Constructor & Destructor Documentation

◆ thread_hazard_list()

kcenon::thread::detail::thread_hazard_list::thread_hazard_list ( )
inline

Definition at line 39 of file hazard_pointer.h.

39 : next(nullptr), active(true) {
40 for (auto& h : hazards) {
41 h.store(nullptr, std::memory_order_relaxed);
42 }
43 }
std::atomic< void * > hazards[MAX_HAZARDS_PER_THREAD]

References hazards.

Member Data Documentation

◆ active

◆ hazards

◆ MAX_HAZARDS_PER_THREAD

size_t kcenon::thread::detail::thread_hazard_list::MAX_HAZARDS_PER_THREAD = 8
staticconstexpr

◆ next


The documentation for this struct was generated from the following file: