@note Do not include <tt><cds/container/impl/ellen_bintree_map.h></tt> header file directly.
There are header file for each GC type:
- <tt><cds/container/ellen_bintree_map_hp.h></tt> - for Hazard Pointer GC cds::gc::HP
- - <tt><cds/container/ellen_bintree_map_dhp.h></tt> - for Pass-the-Buck GC cds::gc::DHP
+ - <tt><cds/container/ellen_bintree_map_dhp.h></tt> - for Dynamic Hazard Pointer GC cds::gc::DHP
- <tt><cds/container/ellen_bintree_map_rcu.h></tt> - for RCU GC
(see \ref cds_container_EllenBinTreeMap_rcu "RCU-based EllenBinTreeMap")
*/
before end of the map. Therefore, such iteration is more suitable for debugging purpose only
Remember, each iterator object requires 2 additional hazard pointers, that may be
- a limited resource for \p GC like \p gc::HP (for gc::PTB the count of
+ a limited resource for \p GC like \p gc::HP (for gc::DHP the count of
guards is unlimited).
The iterator class supports the following minimalistic interface:
before end of the set. Therefore, such iteration is more suitable for debugging purpose only
Remember, each iterator object requires 2 additional hazard pointers, that may be
- a limited resource for \p GC like \p gc::HP (for \p gc::PTB the count of
+ a limited resource for \p GC like \p gc::HP (for \p gc::DHP the count of
guards is unlimited).
The iterator class supports the following minimalistic interface:
quasi factor. It means that the consumer dequeues any item from the current first segment.
Template parameters:
- - \p GC - a garbage collector, possible types are cds::gc::HP, cds::gc::PTB
+ - \p GC - a garbage collector, possible types are cds::gc::HP, cds::gc::DHP
- \p T - the type of values stored in the queue
- \p Traits - queue type traits, default is \p segmented_queue::traits.
\p segmented_queue::make_traits metafunction can be used to construct your
//$$CDS-header$$
-#ifndef __CDS_CONTAINER_SKIP_LIST_MAP_PTB_H
-#define __CDS_CONTAINER_SKIP_LIST_MAP_PTB_H
+#ifndef __CDS_CONTAINER_SKIP_LIST_MAP_DHP_H
+#define __CDS_CONTAINER_SKIP_LIST_MAP_DHP_H
#include <cds/container/details/skip_list_base.h>
#include <cds/intrusive/skip_list_dhp.h>
#include <cds/container/details/make_skip_list_set.h>
#include <cds/container/impl/skip_list_set.h>
-#endif // #ifndef __CDS_CONTAINER_SKIP_LIST_MAP_PTB_H
+#endif // #ifndef __CDS_CONTAINER_SKIP_LIST_MAP_DHP_H
Now you are ready to declare our map class based on \p %SplitListMap:
\code
- typedef cc::SplitListMap< cds::gc::PTB, int, std::string, foo_set_traits > int_string_map;
+ typedef cc::SplitListMap< cds::gc::DHP, int, std::string, foo_set_traits > int_string_map;
\endcode
You may use the modern option-based declaration instead of classic type-traits-based one:
\code
typedef cc:SplitListMap<
- cs::gc::PTB // GC used
+ cs::gc::DHP // GC used
,int // key type
,std::string // value type
,cc::split_list::make_traits< // metafunction to build split-list traits
Now you are ready to declare our set class based on \p %SplitListSet:
\code
- typedef cc::SplitListSet< cds::gc::PTB, foo, foo_set_traits > foo_set;
+ typedef cc::SplitListSet< cds::gc::DHP, foo, foo_set_traits > foo_set;
\endcode
You may use the modern option-based declaration instead of classic traits-based one:
\code
typedef cc:SplitListSet<
- cs::gc::PTB // GC used
+ cs::gc::DHP // GC used
,foo // type of data stored
,cc::split_list::make_traits< // metafunction to build split-list traits
cc::split_list::ordered_list<cc::lazy_list_tag> // tag for underlying ordered list implementation
#include <cds/gc/dhp/dhp_impl.h>
#include <cds/details/lib.h>
-//@cond
-namespace cds { namespace gc {
- typedef PTB DHP;
-}} // namespace cds::gc
-//@endcond
-
#endif // #ifndef __CDS_GC_DHP_H
namespace cds { namespace gc {
- /// Pass The Buck reclamation schema
+ /// Dynamic Hazard Pointer reclamation schema
/**
- \par Sources:
- - [2002] M. Herlihy, V. Luchangco, and M. Moir. The repeat offender problem: A mechanism for supporting
- dynamic-sized lockfree data structures. Technical Report TR-2002-112, Sun Microsystems Laboratories, 2002
- - [2002] M. Herlihy, V. Luchangco, P. Martin, and M. Moir. Dynamic-sized Lockfree Data Structures.
- Technical Report TR-2002-110, Sun Microsystems Laboratories, 2002
- - [2005] M. Herlihy, V. Luchangco, P. Martin, and M. Moir. Nonblocking Memory Management Support
- for Dynamic-Sized Data Structures. ACM Transactions on Computer Systems, Vol.23, No.2, May 2005
+ The cds::gc::dhp namespace and its members are internal representation of the GC and should not be used directly.
+ Use cds::gc::DHP class in your code.
-
- The cds::gc::dhp namespace and its members are internal representation of the Pass-the-Buck GC and should not be used directly.
- Use cds::gc::PTB class in your code.
-
- Pass-the-Buck (PTB) garbage collector is a singleton. The main user-level part of PTB schema is
- GC class and its nested classes. Before use any PTB-related class you must initialize PTB garbage collector
- by contructing cds::gc::PTB object in beginning of your main().
- See cds::gc::PTB class for explanation.
+ Dynamic Hazard Pointer (DHP) garbage collector is a singleton. The main user-level part of DHP schema is
+ GC class and its nested classes. Before use any DHP-related class you must initialize DHP garbage collector
+ by contructing cds::gc::DHP object in beginning of your main().
+ See cds::gc::DHP class for explanation.
\par Implementation issues
- The global list of free guards (cds::gc::dhp::details::guard_allocator) is protected by spin-lock (i.e. serialized).
- It seems that solution should not introduce significant performance bottleneck, because each thread has own set
- of guards allocated from global list of free guards and access to global list is occurred only when
- all thread's guard is busy. In this case the thread allocates next block of guards from global list.
+ The global list of free guards (\p cds::gc::dhp::details::guard_allocator) is protected by a spin-lock (i.e. serialized).
+ It seems that this solution should not introduce significant performance bottleneck, because each thread has its own set
+ of guards allocated from the global list of free guards and the access to the global list is occurred only when
+ all thread's guard is busy. In this case the thread allocates a next block of guards from the global list.
Guards allocated for the thread is push back to the global list only when the thread terminates.
*/
namespace dhp {
using cds::gc::details::free_retired_ptr_func;
- /// Details of Pass the Buck algorithm
+ /// Details of Dynamic Hazard Pointer algorithm
namespace details {
// Forward declaration
return m_nItemCount.fetch_add( 1, atomics::memory_order_relaxed ) + 1;
}
- /// Result of \ref ptb_gc_privatve "privatize" function.
+ /// Result of \ref dhp_gc_privatve "privatize" function.
/**
The \p privatize function returns retired node list as \p first and the size of that list as \p second.
*/
typedef std::pair<retired_ptr_node *, size_t> privatize_result;
/// Gets current list of retired pointer and clears the list
- /**@anchor ptb_gc_privatve
+ /**@anchor dhp_gc_privatve
*/
privatize_result privatize()
{
/// Returns guard allocated back to pool of free guards
~Guard(); // inline after GarbageCollector
- /// Returns PTB GC object
+ /// Returns DHP GC object
ThreadGC& getGC()
{
return m_gc;
return c_nCapacity;
}
- /// Returns PTB ThreadGC object
+ /// Returns DHP ThreadGC object
ThreadGC& getGC() CDS_NOEXCEPT
{
return m_gc;
public:
/// Exception "No GarbageCollector object is created"
- CDS_DECLARE_EXCEPTION( PTBManagerEmpty, "Global PTB GarbageCollector is NULL" );
+ CDS_DECLARE_EXCEPTION( DHPManagerEmpty, "Global DHP GarbageCollector is NULL" );
/// Internal GC statistics
struct InternalState
bool m_bStatEnabled ; ///< Internal Statistics enabled
public:
- /// Initializes PTB memory manager singleton
+ /// Initializes DHP memory manager singleton
/**
- This member function creates and initializes PTB global object.
- The function should be called before using CDS data structure based on cds::gc::PTB GC. Usually,
+ This member function creates and initializes DHP global object.
+ The function should be called before using CDS data structure based on cds::gc::DHP GC. Usually,
this member function is called in the \p main() function. See cds::gc::dhp for example.
- After calling of this function you may use CDS data structures based on cds::gc::PTB.
+ After calling of this function you may use CDS data structures based on cds::gc::DHP.
\par Parameters
\li \p nLiberateThreshold - the liberate threshold. When count of retired pointers reaches this value,
- the \ref ptb_gc_liberate "liberate" member function would be called for freeing retired pointers.
- If \p nLiberateThreshold <= 1, \p liberate would called after each \ref ptb_gc_retirePtr "retirePtr" call.
+ the \ref dhp_gc_liberate "liberate" member function would be called for freeing retired pointers.
+ If \p nLiberateThreshold <= 1, \p liberate would called after each \ref dhp_gc_retirePtr "retirePtr" call.
\li \p nInitialThreadGuardCount - initial count of guard allocated for ThreadGC. When a thread
is initialized the GC allocates local guard pool for the thread from common guard pool.
By perforce the local thread's guard pool is grown automatically from common pool.
, size_t nInitialThreadGuardCount = 8
);
- /// Destroys PTB memory manager
+ /// Destroys DHP memory manager
/**
- The member function destroys PTB global object. After calling of this function you may \b NOT
- use CDS data structures based on cds::gc::PTB. Usually, the \p Destruct function is called
+ The member function destroys DHP global object. After calling of this function you may \b NOT
+ use CDS data structures based on cds::gc::DHP. Usually, the \p Destruct function is called
at the end of your \p main(). See cds::gc::dhp for example.
*/
static void CDS_STDCALL Destruct();
/// Returns pointer to GarbageCollector instance
/**
- If PTB GC is not initialized, \p PTBManagerEmpty exception is thrown
+ If DHP GC is not initialized, \p DHPManagerEmpty exception is thrown
*/
static GarbageCollector& instance()
{
if ( m_pManager == nullptr )
- throw PTBManagerEmpty();
+ throw DHPManagerEmpty();
return *m_pManager;
}
}
/// Places retired pointer \p and its deleter \p pFunc into thread's array of retired pointer for deferred reclamation
- /**@anchor ptb_gc_retirePtr
+ /**@anchor dhp_gc_retirePtr
*/
template <typename T>
void retirePtr( T * p, void (* pFunc)(T *) )
protected:
/// Liberate function
- /** @anchor ptb_gc_liberate
- The main function of Pass The Buck algorithm. It tries to free retired pointers if they are not
+ /** @anchor dhp_gc_liberate
+ The main function of Dynamic Hazard Pointer algorithm. It tries to free retired pointers if they are not
trapped by any guard.
*/
void liberate();
/// Thread GC
/**
- To use Pass The Buck reclamation schema each thread object must be linked with the object of ThreadGC class
+ To use Dynamic Hazard Pointer reclamation schema each thread object must be linked with the object of ThreadGC class
that interacts with GarbageCollector global object. The linkage is performed by calling \ref cds_threading "cds::threading::Manager::attachThread()"
- on the start of each thread that uses PTB GC. Before terminating the thread linked to PTB GC it is necessary to call
+ on the start of each thread that uses DHP GC. Before terminating the thread linked to DHP GC it is necessary to call
\ref cds_threading "cds::threading::Manager::detachThread()".
The ThreadGC object maintains two list:
namespace cds { namespace gc {
- /// Pass-the-Buck garbage collector
+ /// Dynamic Hazard Pointer garbage collector
/** @ingroup cds_garbage_collector
@headerfile cds/gc/dhp.h
- This class is a wrapper for Pass-the-Buck garbage collector internal implementation.
-
- Sources:
- - [2002] M. Herlihy, V. Luchangco, and M. Moir. The repeat offender problem: A mechanism for supporting
- dynamic-sized lockfree data structures. Technical Report TR-2002-112, Sun Microsystems Laboratories, 2002
- - [2002] M. Herlihy, V. Luchangco, P. Martin, and M. Moir. Dynamic-sized Lockfree Data Structures.
- Technical Report TR-2002-110, Sun Microsystems Laboratories, 2002
- - [2005] M. Herlihy, V. Luchangco, P. Martin, and M. Moir. Nonblocking Memory Management Support
- for Dynamic_Sized Data Structures. ACM Transactions on Computer Systems, Vol.23, No.2, May 2005
+ This class is a wrapper for Dynamic Hazard Pointer garbage collector internal implementation.
See \ref cds_how_to_use "How to use" section for details of garbage collector applying.
*/
- class PTB
+ class DHP
{
public:
/// Native guarded pointer type
/// Wrapper for dhp::ThreadGC class
/**
@headerfile cds/gc/dhp.h
- This class performs automatically attaching/detaching Pass-the-Buck GC
+ This class performs automatically attaching/detaching Dynamic Hazard Pointer GC
for the current thread.
*/
class thread_gc: public thread_gc_impl
public:
/// Constructor
/**
- The constructor attaches the current thread to the Pass-the-Buck GC
+ The constructor attaches the current thread to the Dynamic Hazard Pointer GC
if it is not yet attached.
The \p bPersistent parameter specifies attachment persistence:
- - \p true - the class destructor will not detach the thread from Pass-the-Buck GC.
- - \p false (default) - the class destructor will detach the thread from Pass-the-Buck GC.
+ - \p true - the class destructor will not detach the thread from Dynamic Hazard Pointer GC.
+ - \p false (default) - the class destructor will detach the thread from Dynamic Hazard Pointer GC.
*/
thread_gc(
bool bPersistent = false
- ) ; // inline in ptb_impl.h
+ ) ; // inline in dhp_impl.h
/// Destructor
/**
If the object has been created in persistent mode, the destructor does nothing.
- Otherwise it detaches the current thread from Pass-the-Buck GC.
+ Otherwise it detaches the current thread from Dynamic Hazard Pointer GC.
*/
- ~thread_gc() ; // inline in ptb_impl.h
+ ~thread_gc() ; // inline in dhp_impl.h
};
- /// Pass-the-Buck guard
+ /// Dynamic Hazard Pointer guard
/**
@headerfile cds/gc/dhp.h
This class is a wrapper for dhp::Guard.
public:
//@cond
- Guard() ; // inline in ptb_impl.h
+ Guard() ; // inline in dhp_impl.h
//@endcond
/// Protects a pointer of type <tt> atomic<T*> </tt>
};
- /// Array of Pass-the-Buck guards
+ /// Array of Dynamic Hazard Pointer guards
/**
@headerfile cds/gc/dhp.h
This class is a wrapper for dhp::GuardArray template.
- Template parameter \p Count defines the size of PTB array.
+ Template parameter \p Count defines the size of DHP array.
*/
template <size_t Count>
class GuardArray: public dhp::GuardArray<Count>
public:
//@cond
- GuardArray() ; // inline in ptb_impl.h
+ GuardArray() ; // inline in dhp_impl.h
//@endcond
/// Protects a pointer of type \p atomic<T*>
The constructor calls GarbageCollector::Construct with passed parameters.
See dhp::GarbageCollector::Construct for explanation of parameters meaning.
*/
- PTB(
+ DHP(
size_t nLiberateThreshold = 1024
, size_t nInitialThreadGuardCount = 8
)
/**
The destructor calls \code dhp::GarbageCollector::Destruct() \endcode
*/
- ~PTB()
+ ~DHP()
{
dhp::GarbageCollector::Destruct();
}
/// Checks if count of hazard pointer is no less than \p nCountNeeded
/**
The function always returns \p true since the guard count is unlimited for
- PTB garbage collector.
+ DHP garbage collector.
*/
static bool check_available_guards( size_t nCountNeeded, bool /*bRaiseException*/ = true )
{
retire( p, cds::details::static_functor<Disposer, T>::call );
}
- /// Checks if Pass-the-Buck GC is constructed and may be used
+ /// Checks if Dynamic Hazard Pointer GC is constructed and may be used
static bool isUsed()
{
return dhp::GarbageCollector::isUsed();
/**
Usually, this function should not be called directly.
*/
- static void scan() ; // inline in ptb_impl.h
+ static void scan() ; // inline in dhp_impl.h
/// Synonym for \ref scan()
static void force_dispose()
//@cond
namespace cds { namespace gc {
- inline PTB::thread_gc::thread_gc(
+ inline DHP::thread_gc::thread_gc(
bool bPersistent
)
: m_bPersistent( bPersistent )
cds::threading::Manager::attachThread();
}
- inline PTB::thread_gc::~thread_gc()
+ inline DHP::thread_gc::~thread_gc()
{
if ( !m_bPersistent )
cds::threading::Manager::detachThread();
}
- inline PTB::Guard::Guard()
- : Guard::base_class( cds::threading::getGC<PTB>() )
+ inline DHP::Guard::Guard()
+ : Guard::base_class( cds::threading::getGC<DHP>() )
{}
template <size_t COUNT>
- inline PTB::GuardArray<COUNT>::GuardArray()
- : GuardArray::base_class( cds::threading::getGC<PTB>() )
+ inline DHP::GuardArray<COUNT>::GuardArray()
+ : GuardArray::base_class( cds::threading::getGC<DHP>() )
{}
- inline void PTB::scan()
+ inline void DHP::scan()
{
- cds::threading::getGC<PTB>().scan();
+ cds::threading::getGC<DHP>().scan();
}
}} // namespace cds::gc
<tr>
<th>Feature</th>
<th>%cds::gc::HP</th>
- <th>%cds::gc::PTB</th>
+ <th>%cds::gc::DHP</th>
</tr>
<tr>
<td>Implementation quality</td>
@note Do not include <tt><cds/intrusive/impl/ellen_bintree.h></tt> header file explicitly.
There are header file for each GC type:
- <tt><cds/intrusive/ellen_bintree_hp.h></tt> - for Hazard Pointer GC \p cds::gc::HP
- - <tt><cds/intrusive/ellen_bintree_dhp.h></tt> - for Pass-the-Buck GC \p cds::gc::DHP
+ - <tt><cds/intrusive/ellen_bintree_dhp.h></tt> - for Dynamic Hazard Pointer GC \p cds::gc::DHP
- <tt><cds/intrusive/ellen_bintree_rcu.h></tt> - for RCU (see \ref cds_intrusive_EllenBinTree_rcu "RCU-based EllenBinTree")
<b>Template arguments</b> :
quasi factor. This means that the consumer dequeues <i>any</i> item from the current first segment.
Template parameters:
- - \p GC - a garbage collector, possible types are cds::gc::HP, cds::gc::PTB
+ - \p GC - a garbage collector, possible types are cds::gc::HP, cds::gc::DHP
- \p T - the type of values stored in the queue
- \p Traits - queue type traits, default is \p segmented_queue::traits.
\p segmented_queue::make_traits metafunction can be used to construct the
// Get cds::gc::HP thread GC implementation for current thread
static gc::HP::thread_gc_impl& getHZPGC();
- // Get cds::gc::PTB thread GC implementation for current thread;
- static gc::PTB::thread_gc_impl& getPTBGC();
+ // Get cds::gc::DHP thread GC implementation for current thread;
+ static gc::DHP::thread_gc_impl& getDHPGC();
};
\endcode
struct ThreadData {
//@cond
- char CDS_DATA_ALIGNMENT(8) m_hpManagerPlaceholder[sizeof(cds::gc::HP::thread_gc_impl)] ; ///< Michael's Hazard Pointer GC placeholder
- char CDS_DATA_ALIGNMENT(8) m_ptbManagerPlaceholder[sizeof(cds::gc::PTB::thread_gc_impl)] ; ///< Pass The Buck GC placeholder
+ char CDS_DATA_ALIGNMENT(8) m_hpManagerPlaceholder[sizeof(cds::gc::HP::thread_gc_impl)]; ///< Michael's Hazard Pointer GC placeholder
+ char CDS_DATA_ALIGNMENT(8) m_dhpManagerPlaceholder[sizeof(cds::gc::DHP::thread_gc_impl)]; ///< Dynamic Hazard Pointer GC placeholder
cds::urcu::details::thread_data< cds::urcu::general_instant_tag > * m_pGPIRCU;
cds::urcu::details::thread_data< cds::urcu::general_buffered_tag > * m_pGPBRCU;
//@endcond
cds::gc::HP::thread_gc_impl * m_hpManager ; ///< Michael's Hazard Pointer GC thread-specific data
- cds::gc::PTB::thread_gc_impl * m_ptbManager ; ///< Pass The Buck GC thread-specific data
+ cds::gc::DHP::thread_gc_impl * m_dhpManager ; ///< Dynamic Hazard Pointer GC thread-specific data
size_t m_nFakeProcessorNumber ; ///< fake "current processor" number
else
m_hpManager = nullptr;
- if ( cds::gc::PTB::isUsed() )
- m_ptbManager = new (m_ptbManagerPlaceholder) cds::gc::PTB::thread_gc_impl;
+ if ( cds::gc::DHP::isUsed() )
+ m_dhpManager = new (m_dhpManagerPlaceholder) cds::gc::DHP::thread_gc_impl;
else
- m_ptbManager = nullptr;
+ m_dhpManager = nullptr;
}
~ThreadData()
m_hpManager = nullptr;
}
- if ( m_ptbManager ) {
- typedef cds::gc::PTB::thread_gc_impl ptb_thread_gc_impl;
- m_ptbManager->~ptb_thread_gc_impl();
- m_ptbManager = nullptr;
+ if ( m_dhpManager ) {
+ typedef cds::gc::DHP::thread_gc_impl dhp_thread_gc_impl;
+ m_dhpManager->~dhp_thread_gc_impl();
+ m_dhpManager = nullptr;
}
assert( m_pGPIRCU == nullptr );
if ( m_nAttachCount++ == 0 ) {
if ( cds::gc::HP::isUsed() )
m_hpManager->init();
- if ( cds::gc::PTB::isUsed() )
- m_ptbManager->init();
+ if ( cds::gc::DHP::isUsed() )
+ m_dhpManager->init();
if ( cds::urcu::details::singleton<cds::urcu::general_instant_tag>::isUsed() )
m_pGPIRCU = cds::urcu::details::singleton<cds::urcu::general_instant_tag>::attach_thread();
bool fini()
{
if ( --m_nAttachCount == 0 ) {
- if ( cds::gc::PTB::isUsed() )
- m_ptbManager->fini();
+ if ( cds::gc::DHP::isUsed() )
+ m_dhpManager->fini();
if ( cds::gc::HP::isUsed() )
m_hpManager->fini();
return *(_threadData()->m_hpManager);
}
- /// Get gc::PTB thread GC implementation for current thread
+ /// Get gc::DHP thread GC implementation for current thread
/**
The object returned may be uninitialized if you did not call attachThread in the beginning of thread execution
- or if you did not use gc::PTB.
- To initialize gc::PTB GC you must constuct cds::gc::PTB object in the beginning of your application
+ or if you did not use gc::DHP.
+ To initialize gc::DHP GC you must constuct cds::gc::DHP object in the beginning of your application
*/
- static gc::PTB::thread_gc_impl& getPTBGC()
+ static gc::DHP::thread_gc_impl& getDHPGC()
{
- assert( _threadData()->m_ptbManager != nullptr );
- return *(_threadData()->m_ptbManager);
+ assert( _threadData()->m_dhpManager != nullptr );
+ return *(_threadData()->m_dhpManager);
}
//@cond
return *(_threadData()->m_hpManager);
}
- /// Get gc::PTB thread GC implementation for current thread
+ /// Get gc::DHP thread GC implementation for current thread
/**
The object returned may be uninitialized if you did not call attachThread in the beginning of thread execution
- or if you did not use gc::PTB.
- To initialize gc::PTB GC you must constuct cds::gc::PTB object in the beginning of your application
+ or if you did not use gc::DHP.
+ To initialize gc::DHP GC you must constuct cds::gc::DHP object in the beginning of your application
*/
- static gc::PTB::thread_gc_impl& getPTBGC()
+ static gc::DHP::thread_gc_impl& getDHPGC()
{
- assert( _threadData()->m_ptbManager );
- return *(_threadData()->m_ptbManager);
+ assert( _threadData()->m_dhpManager );
+ return *(_threadData()->m_dhpManager);
}
//@cond
return *(_threadData()->m_hpManager);
}
- /// Get gc::PTB thread GC implementation for current thread
+ /// Get gc::DHP thread GC implementation for current thread
/**
The object returned may be uninitialized if you did not call attachThread in the beginning of thread execution
- or if you did not use gc::PTB.
- To initialize gc::PTB GC you must constuct cds::gc::PTB object in the beginning of your application
+ or if you did not use gc::DHP.
+ To initialize gc::DHP GC you must constuct cds::gc::DHP object in the beginning of your application
*/
- static gc::PTB::thread_gc_impl& getPTBGC()
+ static gc::DHP::thread_gc_impl& getDHPGC()
{
- assert( _threadData()->m_ptbManager );
- return *(_threadData()->m_ptbManager);
+ assert( _threadData()->m_dhpManager );
+ return *(_threadData()->m_dhpManager);
}
//@cond
return *(_threadData( do_getData )->m_hpManager);
}
- /// Get gc::PTB thread GC implementation for current thread
+ /// Get gc::DHP thread GC implementation for current thread
/**
The object returned may be uninitialized if you did not call attachThread in the beginning of thread execution
- or if you did not use gc::PTB.
- To initialize gc::PTB GC you must constuct cds::gc::PTB object in the beginning of your application
+ or if you did not use gc::DHP.
+ To initialize gc::DHP GC you must constuct cds::gc::DHP object in the beginning of your application
*/
- static gc::PTB::thread_gc_impl& getPTBGC()
+ static gc::DHP::thread_gc_impl& getDHPGC()
{
- return *(_threadData( do_getData )->m_ptbManager);
+ return *(_threadData( do_getData )->m_dhpManager);
}
//@cond
return *(_threadData( do_getData )->m_hpManager);
}
- /// Get gc::PTB thread GC implementation for current thread
+ /// Get gc::DHP thread GC implementation for current thread
/**
The object returned may be uninitialized if you did not call attachThread in the beginning of thread execution
- or if you did not use gc::PTB.
- To initialize gc::PTB GC you must constuct cds::gc::PTB object in the beginning of your application
+ or if you did not use gc::DHP.
+ To initialize gc::DHP GC you must constuct cds::gc::DHP object in the beginning of your application
*/
- static gc::PTB::thread_gc_impl& getPTBGC()
+ static gc::DHP::thread_gc_impl& getDHPGC()
{
- return *(_threadData( do_getData )->m_ptbManager);
+ return *(_threadData( do_getData )->m_dhpManager);
}
//@cond
return Manager::getHZPGC();
}
- /// Get cds::gc::PTB thread GC implementation for current thread
+ /// Get cds::gc::DHP thread GC implementation for current thread
/**
The object returned may be uninitialized if you did not call attachThread in the beginning of thread execution
- or if you did not use cds::gc::PTB.
- To initialize cds::gc::PTB GC you must constuct cds::gc::PTB object in the beginning of your application,
+ or if you did not use cds::gc::DHP.
+ To initialize cds::gc::DHP GC you must constuct cds::gc::DHP object in the beginning of your application,
see \ref cds_how_to_use "How to use libcds"
*/
template <>
- inline cds::gc::PTB::thread_gc_impl& getGC<cds::gc::PTB>()
+ inline cds::gc::DHP::thread_gc_impl& getGC<cds::gc::DHP>()
{
- return Manager::getPTBGC();
+ return Manager::getDHPGC();
}
//@cond
//$$CDS-header$$
-// Pass The Buck (PTB) Memory manager implementation
+// Dynamic Hazard Pointer memory manager implementation
#include <algorithm> // std::fill
#include <functional> // std::hash
// Safe reclamation schemes
cds::gc::HP hzpGC( nHazardPtrCount );
- cds::gc::PTB ptbGC;
+ cds::gc::DHP dhpGC;
// RCU varieties
typedef cds::urcu::gc< cds::urcu::general_instant<> > rcu_gpi;
namespace tree {
namespace ellen_bintree_dhp {
- typedef cds::intrusive::ellen_bintree::node_types<cds::gc::PTB, IntrusiveBinTreeHdrTest::key_type> node_types;
+ typedef cds::intrusive::ellen_bintree::node_types<cds::gc::DHP, IntrusiveBinTreeHdrTest::key_type> node_types;
typedef node_types::leaf_node_type leaf_node;
typedef IntrusiveBinTreeHdrTest::base_hook_value< leaf_node > base_value;
typedef node_types::internal_node_type internal_node;