Tervel  1.0.0
A collection of wait-free containers and algorithms.
Classes | Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
tervel::util::memory::hp::ListManager Class Reference

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 ()
 
ElementListallocate_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
 

Detailed Description

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.

Constructor & Destructor Documentation

tervel::util::memory::hp::ListManager::ListManager ( size_t  number_pools)
inlineexplicit
tervel::util::memory::hp::ListManager::~ListManager ( )

Member Function Documentation

ElementList* tervel::util::memory::hp::ListManager::allocate_list ( )
inline
tervel::util::memory::hp::ListManager::DISALLOW_COPY_AND_ASSIGN ( ListManager  )
private
void tervel::util::memory::hp::ListManager::recieve_element_list ( uint64_t  tid,
Element element_list 
)
inlineprivate

This function is called when a thread is detached.

It moves elements from its private HP pool to the shared pool.

Parameters
tidThe threads tervel id
element_listThe list of elements that it owned.

Friends And Related Function Documentation

friend class ElementList
friend

Member Data Documentation

std::unique_ptr<ManagedPool[]> tervel::util::memory::hp::ListManager::free_lists_
private
size_t tervel::util::memory::hp::ListManager::number_pools_
private

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