Tervel
1.0.0
A collection of wait-free containers and algorithms.
|
Encapsulates a shared central 'to free list' between several thread-local lists. More...
#include <list_manager.h>
Classes | |
struct | ManagedPool |
Public Member Functions | |
ListManager (size_t number_pools) | |
~ListManager () | |
ElementList * | allocate_list () |
Private Member Functions | |
void | recieve_element_list (uint64_t tid, Element *element_list) |
This function is called when a thread is detached. More... | |
DISALLOW_COPY_AND_ASSIGN (ListManager) | |
Private Attributes | |
std::unique_ptr< ManagedPool[]> | free_lists_ |
size_t | number_pools_ |
Friends | |
class | ElementList |
Encapsulates a shared central 'to free list' between several thread-local lists.
When a thread is destroyed it will send its unfreeable items to this list, which is freed by the user.
|
inlineexplicit |
tervel::util::memory::hp::ListManager::~ListManager | ( | ) |
|
inline |
|
private |
|
inlineprivate |
This function is called when a thread is detached.
It moves elements from its private HP pool to the shared pool.
tid | The threads tervel id |
element_list | The list of elements that it owned. |
|
friend |
|
private |
|
private |