Rename class cds::gc::PTB to cds::gc::DHP
authorkhizmax <khizmax@gmail.com>
Fri, 14 Nov 2014 16:09:38 +0000 (19:09 +0300)
committerkhizmax <khizmax@gmail.com>
Fri, 14 Nov 2014 16:09:38 +0000 (19:09 +0300)
24 files changed:
cds/container/impl/ellen_bintree_map.h
cds/container/impl/skip_list_map.h
cds/container/impl/skip_list_set.h
cds/container/segmented_queue.h
cds/container/skip_list_set_dhp.h
cds/container/split_list_map.h
cds/container/split_list_set.h
cds/gc/dhp.h
cds/gc/dhp/dhp.h
cds/gc/dhp/dhp_decl.h
cds/gc/dhp/dhp_impl.h
cds/gc/hp/hp.h
cds/intrusive/impl/ellen_bintree.h
cds/intrusive/segmented_queue.h
cds/threading/details/_common.h
cds/threading/details/cxx11_manager.h
cds/threading/details/gcc_manager.h
cds/threading/details/msvc_manager.h
cds/threading/details/pthread_manager.h
cds/threading/details/wintls_manager.h
cds/threading/model.h
src/dhp_gc.cpp
tests/cppunit/test_main.cpp
tests/test-hdr/tree/hdr_intrusive_ellen_bintree_pool_dhp.h

index 3ca0dbf2698da14bb9de369932f9ac45cb567140..3187f55b8dd6105b43f227b35c8adc42f619cce8 100644 (file)
@@ -50,7 +50,7 @@ namespace cds { namespace container {
         @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")
     */
index e2c17d03b6479dc3a42c144e5a9efc68ce6387ac..98f73d669b1da14a4615f3fa40b0b8bf144e37af 100644 (file)
@@ -67,7 +67,7 @@ namespace cds { namespace container {
         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:
index a281df79472b7ad23626bc2db449b97242ca1c0b..9de1eb5ec6c928fdaa389b7dee0189113826a4cf 100644 (file)
@@ -65,7 +65,7 @@ namespace cds { namespace container {
         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:
index ea4cd957dc1506cd43fd76e649a589d4670d2ab2..69361eecd08a3b9f9e46dbb484d2d0423a37cd71 100644 (file)
@@ -167,7 +167,7 @@ namespace cds { namespace container {
         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
index 3e0d26e9805018cd226db9f6cfec78a7f5e95b34..4b86615d7f0273846d484dbe329204c6549a77d2 100644 (file)
@@ -1,11 +1,11 @@
 //$$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
index 05ecd615aa0458d19dce4391862444d282efa1ef..c3c8b0552cda4223660a225e6e87c595858bb2be 100644 (file)
@@ -70,13 +70,13 @@ namespace cds { namespace container {
 
         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
index 24a2cbb8fdb11b6df9b259e29684d03a7b82a395..b4a6a39edb8398677cd93dc3a7c3eb485a8efaa3 100644 (file)
@@ -90,13 +90,13 @@ namespace cds { namespace container {
 
         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
index c854b91aabf1b2aa1ab63315984a368c09aa8487..6209e815807f142ee5d33b4d1d52d3a7e89d09c2 100644 (file)
@@ -7,10 +7,4 @@
 #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
index f90d5f200998f1f3ca15f2a8378aac59fcb2ce25..7cf050dc8ffde7e3468b2c8622e44525746cbe3d 100644 (file)
 
 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 {
@@ -56,7 +47,7 @@ namespace cds { namespace gc {
 
         using cds::gc::details::free_retired_ptr_func;
 
-        /// Details of Pass the Buck algorithm
+        /// Details of Dynamic Hazard Pointer algorithm
         namespace details {
 
             // Forward declaration
@@ -292,14 +283,14 @@ namespace cds { namespace gc {
                     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()
                 {
@@ -585,7 +576,7 @@ namespace cds { namespace gc {
             /// 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;
@@ -644,7 +635,7 @@ namespace cds { namespace gc {
                 return c_nCapacity;
             }
 
-            /// Returns PTB ThreadGC object
+            /// Returns DHP ThreadGC object
             ThreadGC& getGC() CDS_NOEXCEPT
             {
                 return m_gc;
@@ -709,7 +700,7 @@ namespace cds { namespace 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
@@ -748,17 +739,17 @@ namespace cds { namespace gc {
             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.
@@ -770,22 +761,22 @@ namespace cds { namespace gc {
                 , 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;
             }
 
@@ -824,7 +815,7 @@ namespace cds { namespace gc {
             }
 
             /// 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 *) )
@@ -841,8 +832,8 @@ namespace cds { namespace gc {
 
         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();
@@ -886,9 +877,9 @@ namespace cds { namespace gc {
 
         /// 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:
index 7f55d9819df8632dbcbf504b3b4baf9361ce7324..651d3127cdf81318a34630255ad57757de7765b9 100644 (file)
@@ -9,22 +9,14 @@
 
 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
@@ -54,7 +46,7 @@ namespace cds { namespace gc {
         /// 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
@@ -65,26 +57,26 @@ namespace cds { namespace gc {
         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.
@@ -97,7 +89,7 @@ namespace cds { namespace gc {
 
         public:
             //@cond
-            Guard() ;   // inline in ptb_impl.h
+            Guard() ;   // inline in dhp_impl.h
             //@endcond
 
             /// Protects a pointer of type <tt> atomic<T*> </tt>
@@ -205,11 +197,11 @@ namespace cds { namespace gc {
 
         };
 
-        /// 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>
@@ -226,7 +218,7 @@ namespace cds { namespace gc {
 
         public:
             //@cond
-            GuardArray()    ;   // inline in ptb_impl.h
+            GuardArray()    ;   // inline in dhp_impl.h
             //@endcond
 
             /// Protects a pointer of type \p atomic<T*>
@@ -341,7 +333,7 @@ namespace cds { namespace gc {
             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
         )
@@ -356,7 +348,7 @@ namespace cds { namespace gc {
         /**
             The destructor calls \code dhp::GarbageCollector::Destruct() \endcode
         */
-        ~PTB()
+        ~DHP()
         {
             dhp::GarbageCollector::Destruct();
         }
@@ -364,7 +356,7 @@ namespace cds { namespace gc {
         /// 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 )
         {
@@ -397,7 +389,7 @@ namespace cds { namespace gc {
             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();
@@ -407,7 +399,7 @@ namespace cds { namespace gc {
         /**
             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()
index 2d88afad2f32be12d9bbffc0b2bcbc0b4f55bf4a..a21db87af5daa49006374bd0bd9a6a330de302ce 100644 (file)
@@ -8,7 +8,7 @@
 //@cond
 namespace cds { namespace gc {
 
-    inline PTB::thread_gc::thread_gc(
+    inline DHP::thread_gc::thread_gc(
         bool    bPersistent
         )
         : m_bPersistent( bPersistent )
@@ -17,24 +17,24 @@ namespace cds { namespace gc {
             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
index 30df8116937638d5eda0b0687084112f43645ca3..c2af861beded07527637c6e6ce681da007f44aa3 100644 (file)
@@ -36,7 +36,7 @@ namespace cds {
             <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>
index ca9fa2d30d2f2cc4b86df8bdacebb3d409c94d60..e6f2e9936b9885dce021bc079850f95bdb3b44be 100644 (file)
@@ -44,7 +44,7 @@ namespace cds { namespace intrusive {
         @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> :
index 3b71512772f3c6dffbfd05e31bdeab4907c08a24..d10ab14b27e0b986b4cdeb83d3781c91a1875a4d 100644 (file)
@@ -187,7 +187,7 @@ namespace cds { namespace intrusive {
         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
index 86f63c544f40fd65a9fc20c3fa3bc7f7babaceac..1079303f0709221a77b951b46533d57c7046ff0f 100644 (file)
@@ -74,8 +74,8 @@ namespace cds {
             // 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
 
@@ -109,8 +109,8 @@ namespace cds {
         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;
@@ -123,7 +123,7 @@ namespace cds {
             //@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
 
@@ -156,10 +156,10 @@ namespace cds {
                 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()
@@ -170,10 +170,10 @@ namespace cds {
                     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 );
@@ -190,8 +190,8 @@ namespace cds {
                 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();
@@ -211,8 +211,8 @@ namespace cds {
             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();
 
index 625380a61e29093002aca5db4dae60beec976a5f..e2b56b07d17456a5d3bc75e39b957d9ddd387f93 100644 (file)
@@ -107,16 +107,16 @@ namespace cds { namespace threading {
                 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
index 0c0c7e2ace5206d0d381abd577ffc299a3aff773..a317e78ca771bf9012852150bae0623fd6968fc9 100644 (file)
@@ -107,16 +107,16 @@ namespace cds { namespace threading {
                 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
index c6660a013e0bba0288927b20e8cb3439aef24956..ab062d95f2dc3cc033b55ee407d2358b999a7fb6 100644 (file)
@@ -107,16 +107,16 @@ namespace cds { namespace threading {
                 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
index 99fadd5aafee899535e9a9f7d32b00271a6e7912..ab7b6a8f011a9893897e7cf48d5477676a8da5d4 100644 (file)
@@ -204,15 +204,15 @@ namespace cds { namespace threading {
                 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
index 47b2de3c82dd70e00a92f83e11b3aef7157f1c9b..5ffdc9817d9e7f0a88caf14b5cf21d974aa7672e 100644 (file)
@@ -207,15 +207,15 @@ namespace cds { namespace threading {
                 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
index 3a7bd340ce6e0c9739f4a36b8f311dca191ab0df..4ae5ce7e3fbac02772896d84eb7cd63122e1fc88 100644 (file)
@@ -31,17 +31,17 @@ namespace cds { namespace threading {
         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
index 1a2902a25295765f0c8817c0cdf45f78e2f5062c..9b72a73c0cbf6c59c218c47d45a636116a8c2138 100644 (file)
@@ -1,6 +1,6 @@
 //$$CDS-header$$
 
-// Pass The Buck (PTB) Memory manager implementation
+// Dynamic Hazard Pointer memory manager implementation
 
 #include <algorithm>   // std::fill
 #include <functional>  // std::hash
index 485f95c1e6f2155c84b6e045cf067652d391d861..d9dfcc1bb80e399de4f65b821251985d472c012a 100644 (file)
@@ -331,7 +331,7 @@ int main(int argc, char** argv)
 
       // 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;
index 8c67b6525b4bc5bef97d0f68f81178e7666d99b7..9cbef05732e927d92ed1cd724e71387aaee64eb7 100644 (file)
@@ -12,7 +12,7 @@
 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;