|
Thread System 0.3.1
High-performance C++20 thread pool with work stealing and DAG scheduling
|
Global manager for orphaned nodes from terminated threads. More...
#include <hazard_pointer.h>

Public Member Functions | |
| void | add_orphaned_nodes (retire_node *head, size_t count) |
| Add a list of retired nodes to the global orphanage. | |
| size_t | reclaim (const std::vector< void * > &protected_ptrs) |
| Reclaim orphaned nodes that are no longer protected. | |
| size_t | get_orphaned_count () const |
| Get statistics. | |
Static Public Member Functions | |
| static global_reclamation_manager & | instance () |
Private Member Functions | |
| global_reclamation_manager ()=default | |
Private Attributes | |
| std::atomic< retire_node * > | head_ {nullptr} |
| std::atomic< size_t > | count_ {0} |
Global manager for orphaned nodes from terminated threads.
Definition at line 82 of file hazard_pointer.h.
|
privatedefault |
| void kcenon::thread::detail::global_reclamation_manager::add_orphaned_nodes | ( | retire_node * | head, |
| size_t | count ) |
Add a list of retired nodes to the global orphanage.
| head | Head of the linked list of retired nodes |
| count | Number of nodes in the list |
Definition at line 153 of file hazard_pointer.cpp.
References count_, head_, and kcenon::thread::detail::retire_node::next.
Referenced by reclaim(), and kcenon::thread::hazard_pointer_domain< T >::thread_retire_list::reclaim_all().

| size_t kcenon::thread::detail::global_reclamation_manager::get_orphaned_count | ( | ) | const |
|
static |
Definition at line 148 of file hazard_pointer.cpp.
Referenced by kcenon::thread::hazard_pointer_domain< T >::reclaim(), and kcenon::thread::hazard_pointer_domain< T >::thread_retire_list::reclaim_all().

| size_t kcenon::thread::detail::global_reclamation_manager::reclaim | ( | const std::vector< void * > & | protected_ptrs | ) |
Reclaim orphaned nodes that are no longer protected.
| protected_ptrs | List of currently protected pointers |
Definition at line 175 of file hazard_pointer.cpp.
References add_orphaned_nodes(), count_, kcenon::thread::detail::retire_node::deleter, head_, kcenon::thread::detail::retire_node::next, and kcenon::thread::detail::retire_node::ptr.
Referenced by kcenon::thread::hazard_pointer_domain< T >::reclaim().


|
private |
Definition at line 103 of file hazard_pointer.h.
Referenced by add_orphaned_nodes(), get_orphaned_count(), and reclaim().
|
private |
Definition at line 102 of file hazard_pointer.h.
Referenced by add_orphaned_nodes(), and reclaim().