From 2a749ed169391e4142b340db2b8e580afdbc8f64 Mon Sep 17 00:00:00 2001 From: khizmax Date: Mon, 10 Nov 2014 01:35:08 +0300 Subject: [PATCH] EllenBinTree refactoring --- cds/container/ellen_bintree_map_dhp.h | 9 + cds/container/ellen_bintree_map_ptb.h | 9 - cds/container/ellen_bintree_map_rcu.h | 111 ++---- cds/container/ellen_bintree_set_dhp.h | 9 + cds/container/ellen_bintree_set_ptb.h | 9 - cds/container/ellen_bintree_set_rcu.h | 176 +++------ cds/container/impl/ellen_bintree_map.h | 4 +- cds/container/impl/ellen_bintree_set.h | 4 +- cds/container/skip_list_map_nogc.h | 1 - projects/Win/vc12/cds.vcxproj | 4 +- projects/Win/vc12/cds.vcxproj.filters | 12 +- projects/Win/vc12/hdr-test-tree.vcxproj | 4 +- .../Win/vc12/hdr-test-tree.vcxproj.filters | 12 +- projects/Win/vc12/unit-map-insdel.vcxproj | 1 - tests/test-hdr/tree/hdr_ellenbintree_map.h | 36 +- ...p_ptb.cpp => hdr_ellenbintree_map_dhp.cpp} | 34 +- .../test-hdr/tree/hdr_ellenbintree_map_hp.cpp | 12 +- .../tree/hdr_ellenbintree_map_rcu_gpb.cpp | 45 ++- tests/test-hdr/tree/hdr_ellenbintree_set.h | 36 +- ...t_ptb.cpp => hdr_ellenbintree_set_dhp.cpp} | 33 +- .../test-hdr/tree/hdr_ellenbintree_set_hp.cpp | 12 +- .../tree/hdr_ellenbintree_set_rcu_gpb.cpp | 12 +- tests/unit/map2/map_defs.h | 8 +- tests/unit/map2/map_types.h | 217 ++++------- tests/unit/pqueue/ellen_bintree_pqueue.h | 2 +- tests/unit/pqueue/pqueue_defs.h | 8 + tests/unit/pqueue/pqueue_type.h | 367 +++++------------- tests/unit/set2/set_defs.h | 8 +- tests/unit/set2/set_types.h | 226 ++++------- 29 files changed, 515 insertions(+), 906 deletions(-) create mode 100644 cds/container/ellen_bintree_map_dhp.h delete mode 100644 cds/container/ellen_bintree_map_ptb.h create mode 100644 cds/container/ellen_bintree_set_dhp.h delete mode 100644 cds/container/ellen_bintree_set_ptb.h rename tests/test-hdr/tree/{hdr_ellenbintree_map_ptb.cpp => hdr_ellenbintree_map_dhp.cpp} (81%) rename tests/test-hdr/tree/{hdr_ellenbintree_set_ptb.cpp => hdr_ellenbintree_set_dhp.cpp} (83%) diff --git a/cds/container/ellen_bintree_map_dhp.h b/cds/container/ellen_bintree_map_dhp.h new file mode 100644 index 00000000..91378d43 --- /dev/null +++ b/cds/container/ellen_bintree_map_dhp.h @@ -0,0 +1,9 @@ +//$$CDS-header$$ + +#ifndef __CDS_CONTAINER_ELLEN_BINTREE_MAP_DHP_H +#define __CDS_CONTAINER_ELLEN_BINTREE_MAP_DHP_H + +#include +#include + +#endif // #ifndef __CDS_CONTAINER_ELLEN_BINTREE_MAP_DHP_H diff --git a/cds/container/ellen_bintree_map_ptb.h b/cds/container/ellen_bintree_map_ptb.h deleted file mode 100644 index ab16d52b..00000000 --- a/cds/container/ellen_bintree_map_ptb.h +++ /dev/null @@ -1,9 +0,0 @@ -//$$CDS-header$$ - -#ifndef __CDS_CONTAINER_ELLEN_BINTREE_MAP_PTB_H -#define __CDS_CONTAINER_ELLEN_BINTREE_MAP_PTB_H - -#include -#include - -#endif // #ifndef __CDS_CONTAINER_ELLEN_BINTREE_MAP_PTB_H diff --git a/cds/container/ellen_bintree_map_rcu.h b/cds/container/ellen_bintree_map_rcu.h index a45a8620..e3ad6135 100644 --- a/cds/container/ellen_bintree_map_rcu.h +++ b/cds/container/ellen_bintree_map_rcu.h @@ -40,40 +40,9 @@ namespace cds { namespace container { - \p RCU - one of \ref cds_urcu_gc "RCU type" - \p Key - key type - \p T - value type to be stored in tree's leaf nodes. - - \p Traits - type traits. See ellen_bintree::type_traits for explanation. - - It is possible to declare option-based tree with ellen_bintree::make_map_traits metafunction - instead of \p Traits template argument. - Template argument list \p Options of ellen_bintree::make_map_traits metafunction are: - - opt::compare - key compare functor. No default functor is provided. - If the option is not specified, \p %opt::less is used. - - opt::less - specifies binary predicate used for key compare. At least \p %opt::compare or \p %opt::less should be defined. - - opt::item_counter - the type of item counting feature. Default is \ref atomicity::empty_item_counter that is no item counting. - - opt::memory_model - C++ memory ordering model. Can be opt::v::relaxed_ordering (relaxed memory model, the default) - or opt::v::sequential_consistent (sequentially consisnent memory model). - - opt::allocator - the allocator used for \ref ellen_bintree::map_node "leaf nodes" which contains data. - Default is \ref CDS_DEFAULT_ALLOCATOR. - - opt::node_allocator - the allocator used for \ref ellen_bintree::internal_node "internal nodes". - Default is \ref CDS_DEFAULT_ALLOCATOR. - - ellen_bintree::update_desc_allocator - an allocator of \ref ellen_bintree::update_desc "update descriptors", - default is \ref CDS_DEFAULT_ALLOCATOR. - Note that update descriptor is helping data structure with short lifetime and it is good candidate for pooling. - The number of simultaneously existing descriptors is a relatively small number limited the number of threads - working with the tree and RCU buffer size. - Therefore, a bounded lock-free container like \p cds::container::VyukovMPMCCycleQueue is good choice for the free-list - of update descriptors, see cds::memory::vyukov_queue_pool free-list implementation. - Also notice that size of update descriptor is not dependent on the type of data - stored in the tree so single free-list object can be used for several EllenBinTree-based object. - - opt::stat - internal statistics. Available types: ellen_bintree::stat, ellen_bintree::empty_stat (the default) - - opt::rcu_check_deadlock - a deadlock checking policy. Default is opt::v::rcu_throw_deadlock - - opt::copy_policy - key copy policy defines a functor to copy leaf node's key to internal node. - By default, assignment operator is used. - The copy functor interface is: - \code - struct copy_functor { - void operator()( Key& dest, Key const& src ); - }; - \endcode + - \p Traits - map traits, default is \p ellen_bintree::traits. + It is possible to declare option-based tree with \p ellen_bintree::make_map_traits metafunction + instead of \p Traits template argument. @note Before including you should include appropriate RCU header file, see \ref cds_urcu_gc "RCU type" for list of existing RCU class and corresponding header files. @@ -83,7 +52,7 @@ namespace cds { namespace container { typename Key, typename T, #ifdef CDS_DOXYGEN_INVOKED - class Traits = ellen_bintree::type_traits + class Traits = ellen_bintree::traits #else class Traits #endif @@ -100,27 +69,27 @@ namespace cds { namespace container { typedef typename maker::type base_class; //@endcond public: - typedef cds::urcu::gc gc ; ///< RCU Garbage collector - typedef Key key_type ; ///< type of a key stored in the map - typedef T mapped_type ; ///< type of value stored in the map - typedef std::pair< key_type const, mapped_type > value_type ; ///< Key-value pair stored in leaf node of the mp - typedef Traits options ; ///< Traits template parameter + typedef cds::urcu::gc gc; ///< RCU Garbage collector + typedef Key key_type; ///< type of a key stored in the map + typedef T mapped_type; ///< type of value stored in the map + typedef std::pair< key_type const, mapped_type > value_type; ///< Key-value pair stored in leaf node of the mp + typedef Traits traits; ///< Traits template parameter # ifdef CDS_DOXYGEN_INVOKED - typedef implementation_defined key_comparator ; ///< key compare functor based on opt::compare and opt::less option setter. + typedef implementation_defined key_comparator ; ///< key compare functor based on \p Traits::compare and \p Traits::less # else - typedef typename maker::intrusive_type_traits::compare key_comparator; + typedef typename maker::intrusive_traits::compare key_comparator; # endif - typedef typename base_class::item_counter item_counter ; ///< Item counting policy used - typedef typename base_class::memory_model memory_model ; ///< Memory ordering. See cds::opt::memory_model option - typedef typename base_class::node_allocator node_allocator_type ; ///< allocator for maintaining internal node - typedef typename base_class::stat stat ; ///< internal statistics type - typedef typename base_class::rcu_check_deadlock rcu_check_deadlock ; ///< Deadlock checking policy - typedef typename options::copy_policy copy_policy ; ///< key copy policy + typedef typename base_class::item_counter item_counter; ///< Item counting policy + typedef typename base_class::memory_model memory_model; ///< Memory ordering, see \p cds::opt::memory_model option + typedef typename base_class::node_allocator node_allocator_type; ///< allocator for maintaining internal node + typedef typename base_class::stat stat; ///< internal statistics + typedef typename base_class::rcu_check_deadlock rcu_check_deadlock; ///< Deadlock checking policy + typedef typename traits::copy_policy copy_policy; ///< key copy policy - typedef typename options::allocator allocator_type ; ///< Allocator for leaf nodes - typedef typename base_class::node_allocator node_allocator ; ///< Internal node allocator - typedef typename base_class::update_desc_allocator update_desc_allocator ; ///< Update descriptor allocator + typedef typename traits::allocator allocator_type; ///< Allocator for leaf nodes + typedef typename base_class::node_allocator node_allocator; ///< Internal node allocator + typedef typename base_class::update_desc_allocator update_desc_allocator; ///< Update descriptor allocator static CDS_CONSTEXPR const bool c_bExtractLockExternal = base_class::c_bExtractLockExternal; ///< Group of \p extract_xxx functions do not require external locking @@ -139,7 +108,7 @@ namespace cds { namespace container { typedef typename gc::scoped_lock rcu_lock ; ///< RCU scoped lock /// pointer to extracted node - typedef cds::urcu::exempt_ptr< gc, leaf_node, value_type, typename maker::intrusive_type_traits::disposer, + typedef cds::urcu::exempt_ptr< gc, leaf_node, value_type, typename maker::intrusive_traits::disposer, cds::urcu::details::conventional_exempt_member_cast > exempt_ptr; @@ -158,11 +127,10 @@ namespace cds { namespace container { The function creates a node with \p key and default value, and then inserts the node created into the map. Preconditions: - - The \ref key_type should be constructible from a value of type \p K. - In trivial case, \p K is equal to \ref key_type. - - The \ref mapped_type should be default-constructible. + - The \p key_type should be constructible from a value of type \p K. + - The \p mapped_type should be default-constructible. - RCU \p synchronize method can be called. RCU should not be locked. + RCU \p synchronize() can be called. RCU should not be locked. Returns \p true if inserting successful, \p false otherwise. */ @@ -178,10 +146,10 @@ namespace cds { namespace container { and then inserts the node created into the map. Preconditions: - - The \ref key_type should be constructible from \p key of type \p K. - - The \ref value_type should be constructible from \p val of type \p V. + - The \p key_type should be constructible from \p key of type \p K. + - The \p value_type should be constructible from \p val of type \p V. - RCU \p synchronize method can be called. RCU should not be locked. + RCU \p synchronize() method can be called. RCU should not be locked. Returns \p true if \p val is inserted into the map, \p false otherwise. */ @@ -222,7 +190,7 @@ namespace cds { namespace container { This can be useful if complete initialization of object of \p value_type is heavyweight and it is preferable that the initialization should be completed only if inserting is successful. - RCU \p synchronize method can be called. RCU should not be locked. + RCU \p synchronize() method can be called. RCU should not be locked. */ template bool insert_key( const K& key, Func func ) @@ -235,11 +203,11 @@ namespace cds { namespace container { return false; } - /// For key \p key inserts data of type \ref value_type constructed with std::forward(args)... + /// For key \p key inserts data of type \p value_type created in-place from \p args /** Returns \p true if inserting successful, \p false otherwise. - RCU \p synchronize method can be called. RCU should not be locked. + RCU \p synchronize() method can be called. RCU should not be locked. */ template bool emplace( K&& key, Args&&... args ) @@ -277,11 +245,13 @@ namespace cds { namespace container { The functor may change any fields of the \p item.second that is \ref value_type. - RCU \p synchronize method can be called. RCU should not be locked. + RCU \p synchronize() method can be called. RCU should not be locked. Returns std::pair where \p first is true if operation is successfull, \p second is true if new item has been added or \p false if the item with \p key already is in the list. + + @warning See \ref cds_intrusive_item_creating "insert item troubleshooting" */ template std::pair ensure( K const& key, Func func ) @@ -298,7 +268,7 @@ namespace cds { namespace container { /// Delete \p key from the map /**\anchor cds_nonintrusive_EllenBinTreeMap_rcu_erase_val - RCU \p synchronize method can be called. RCU should not be locked. + RCU \p synchronize() method can be called. RCU should not be locked. Return \p true if \p key is found and deleted, \p false otherwise */ @@ -537,15 +507,21 @@ namespace cds { namespace container { } /// Checks if the map is empty - /** - Emptiness is checked by item counting: if item count is zero then the map is empty. - */ bool empty() const { return base_class::empty(); } /// Returns item count in the map + /** + Only leaf nodes containing user data are counted. + + The value returned depends on item counter type provided by \p Traits template parameter. + If it is \p atomicity::empty_item_counter this function always returns 0. + + The function is not suitable for checking the tree emptiness, use \p empty() + member function for this purpose. + */ size_t size() const { return base_class::size(); @@ -565,7 +541,6 @@ namespace cds { namespace container { { return base_class::check_consistency(); } - }; }} // namespace cds::container diff --git a/cds/container/ellen_bintree_set_dhp.h b/cds/container/ellen_bintree_set_dhp.h new file mode 100644 index 00000000..beaca96b --- /dev/null +++ b/cds/container/ellen_bintree_set_dhp.h @@ -0,0 +1,9 @@ +//$$CDS-header$$ + +#ifndef __CDS_CONTAINER_ELLEN_BINTREE_SET_DHP_H +#define __CDS_CONTAINER_ELLEN_BINTREE_SET_DHP_H + +#include +#include + +#endif // #ifndef __CDS_CONTAINER_ELLEN_BINTREE_SET_DHP_H diff --git a/cds/container/ellen_bintree_set_ptb.h b/cds/container/ellen_bintree_set_ptb.h deleted file mode 100644 index ebba563d..00000000 --- a/cds/container/ellen_bintree_set_ptb.h +++ /dev/null @@ -1,9 +0,0 @@ -//$$CDS-header$$ - -#ifndef __CDS_CONTAINER_ELLEN_BINTREE_SET_PTB_H -#define __CDS_CONTAINER_ELLEN_BINTREE_SET_PTB_H - -#include -#include - -#endif // #ifndef __CDS_CONTAINER_ELLEN_BINTREE_SET_PTB_H diff --git a/cds/container/ellen_bintree_set_rcu.h b/cds/container/ellen_bintree_set_rcu.h index 1a201c0f..f0a0049e 100644 --- a/cds/container/ellen_bintree_set_rcu.h +++ b/cds/container/ellen_bintree_set_rcu.h @@ -40,38 +40,9 @@ namespace cds { namespace container { - \p RCU - one of \ref cds_urcu_gc "RCU type" - \p Key - key type, a subset of \p T - \p T - type to be stored in tree's leaf nodes. - - \p Traits - type traits. See ellen_bintree::type_traits for explanation. - - It is possible to declare option-based tree with ellen_bintree::make_set_traits metafunction - instead of \p Traits template argument. - Template argument list \p Options of ellen_bintree::make_set_traits metafunction are: - - ellen_bintree::key_extractor - key extracting functor, mandatory option. The functor has the following prototype: - \code - struct key_extractor { - void operator ()( Key& dest, T const& src ); - }; - \endcode - It should initialize \p dest key from \p src data. The functor is used to initialize internal nodes. - - opt::compare - key compare functor. No default functor is provided. - If the option is not specified, \p %opt::less is used. - - opt::less - specifies binary predicate used for key compare. At least \p %opt::compare or \p %opt::less should be defined. - - opt::item_counter - the type of item counting feature. Default is \ref atomicity::empty_item_counter that is no item counting. - - opt::memory_model - C++ memory ordering model. Can be opt::v::relaxed_ordering (relaxed memory model, the default) - or opt::v::sequential_consistent (sequentially consisnent memory model). - - opt::allocator - the allocator used for \ref ellen_bintree::node "leaf nodes" which contains data. - Default is \ref CDS_DEFAULT_ALLOCATOR. - - opt::node_allocator - the allocator used for internal nodes. Default is \ref CDS_DEFAULT_ALLOCATOR. - - ellen_bintree::update_desc_allocator - an allocator of \ref ellen_bintree::update_desc "update descriptors", - default is \ref CDS_DEFAULT_ALLOCATOR. - Note that update descriptor is helping data structure with short lifetime and it is good candidate for pooling. - The number of simultaneously existing descriptors is a relatively small number limited the number of threads - working with the tree and RCU buffer size. - Therefore, a bounded lock-free container like \p cds::container::VyukovMPMCCycleQueue is good choice for the free-list - of update descriptors, see cds::memory::vyukov_queue_pool free-list implementation. - Also notice that size of update descriptor is not dependent on the type of data - stored in the tree so single free-list object can be used for several EllenBinTree-based object. - - opt::stat - internal statistics. Available types: ellen_bintree::stat, ellen_bintree::empty_stat (the default) - - opt::rcu_check_deadlock - a deadlock checking policy. Default is opt::v::rcu_throw_deadlock + - \p Traits - set traits, default is \p ellen_bintree::traits. + It is possible to declare option-based tree with \p ellen_bintree::make_set_traits metafunction + instead of \p Traits template argument. @note Before including you should include appropriate RCU header file, see \ref cds_urcu_gc "RCU type" for list of existing RCU class and corresponding header files. @@ -120,7 +91,7 @@ namespace cds { namespace container { typename Key, typename T, #ifdef CDS_DOXYGEN_INVOKED - class Traits = ellen_bintree::type_traits + class Traits = ellen_bintree::traits #else class Traits #endif @@ -138,25 +109,25 @@ namespace cds { namespace container { //@endcond public: - typedef cds::urcu::gc gc ; ///< RCU Garbage collector - typedef Key key_type ; ///< type of a key stored in internal nodes; key is a part of \p value_type - typedef T value_type ; ///< type of value stored in the binary tree - typedef Traits options ; ///< Traits template parameter + typedef cds::urcu::gc gc; ///< RCU Garbage collector + typedef Key key_type; ///< type of a key stored in internal nodes; key is a part of \p value_type + typedef T value_type; ///< type of value stored in the binary tree + typedef Traits traits; ///< Traits template parameter # ifdef CDS_DOXYGEN_INVOKED - typedef implementation_defined key_comparator ; ///< key compare functor based on opt::compare and opt::less option setter. + typedef implementation_defined key_comparator; ///< key compare functor based on \p Traits::compare and \p Traits::less # else - typedef typename maker::intrusive_type_traits::compare key_comparator; + typedef typename maker::intrusive_traits::compare key_comparator; # endif - typedef typename base_class::item_counter item_counter ; ///< Item counting policy used - typedef typename base_class::memory_model memory_model ; ///< Memory ordering. See cds::opt::memory_model option - typedef typename base_class::stat stat ; ///< internal statistics type - typedef typename base_class::rcu_check_deadlock rcu_check_deadlock ; ///< Deadlock checking policy - typedef typename options::key_extractor key_extractor ; ///< key extracting functor + typedef typename base_class::item_counter item_counter; ///< Item counting policy + typedef typename base_class::memory_model memory_model; ///< Memory ordering, see \p cds::opt::memory_model + typedef typename base_class::stat stat; ///< internal statistics type + typedef typename base_class::rcu_check_deadlock rcu_check_deadlock; ///< Deadlock checking policy + typedef typename traits::key_extractor key_extractor; ///< key extracting functor - typedef typename options::allocator allocator_type ; ///< Allocator for leaf nodes - typedef typename base_class::node_allocator node_allocator ; ///< Internal node allocator - typedef typename base_class::update_desc_allocator update_desc_allocator ; ///< Update descriptor allocator + typedef typename traits::allocator allocator_type; ///< Allocator for leaf nodes + typedef typename base_class::node_allocator node_allocator; ///< Internal node allocator + typedef typename base_class::update_desc_allocator update_desc_allocator; ///< Update descriptor allocator static CDS_CONSTEXPR const bool c_bExtractLockExternal = base_class::c_bExtractLockExternal; ///< Group of \p extract_xxx functions do not require external locking @@ -165,14 +136,14 @@ namespace cds { namespace container { typedef typename maker::cxx_leaf_node_allocator cxx_leaf_node_allocator; typedef typename base_class::value_type leaf_node; typedef typename base_class::internal_node internal_node; - typedef std::unique_ptr< leaf_node, typename maker::intrusive_type_traits::disposer > scoped_node_ptr; + typedef std::unique_ptr< leaf_node, typename maker::intrusive_traits::disposer > scoped_node_ptr; //@endcond public: - typedef typename gc::scoped_lock rcu_lock ; ///< RCU scoped lock + typedef typename gc::scoped_lock rcu_lock; ///< RCU scoped lock /// pointer to extracted node - typedef cds::urcu::exempt_ptr< gc, leaf_node, value_type, typename maker::intrusive_type_traits::disposer, + typedef cds::urcu::exempt_ptr< gc, leaf_node, value_type, typename maker::intrusive_traits::disposer, cds::urcu::details::conventional_exempt_member_cast > exempt_ptr; @@ -195,7 +166,7 @@ namespace cds { namespace container { The object of \ref value_type should be constructible from a value of type \p Q. In trivial case, \p Q is equal to \ref value_type. - RCU \p synchronize method can be called. RCU should not be locked. + RCU \p synchronize() method can be called. RCU should not be locked. Returns \p true if \p val is inserted into the set, \p false otherwise. */ @@ -225,7 +196,7 @@ namespace cds { namespace container { \p val no any other changes could be made on this set's item by concurrent threads. The user-defined functor is called only if the inserting is success. - RCU \p synchronize method can be called. RCU should not be locked. + RCU \p synchronize() can be called. RCU should not be locked. */ template bool insert( Q const& val, Func f ) @@ -263,11 +234,13 @@ namespace cds { namespace container { The functor may change non-key fields of the \p item; however, \p func must guarantee that during changing no any other modifications could be made on this item by concurrent threads. - RCU \p synchronize method can be called. RCU should not be locked. + RCU \p synchronize() can be called. RCU should not be locked. Returns std::pair where \p first is true if operation is successfull, \p second is true if new item has been added or \p false if the item with \p key already is in the set. + + @warning See \ref cds_intrusive_item_creating "insert item troubleshooting" */ template std::pair ensure( const Q& val, Func func ) @@ -280,7 +253,7 @@ namespace cds { namespace container { return bRes; } - /// Inserts data of type \ref value_type constructed with std::forward(args)... + /// Inserts data of type \p value_type created in-place from \p args /** Returns \p true if inserting successful, \p false otherwise. @@ -445,25 +418,25 @@ namespace cds { namespace container { cds::details::predicate_wrapper< leaf_node, Less, typename maker::value_accessor >() ); } - /// Find the key \p val + /// Find the key \p key /** @anchor cds_nonintrusive_EllenBinTreeSet_rcu_find_func - The function searches the item with key equal to \p val and calls the functor \p f for item found. + The function searches the item with key equal to \p key and calls the functor \p f for item found. The interface of \p Func functor is: \code struct functor { - void operator()( value_type& item, Q& val ); + void operator()( value_type& item, Q& key ); }; \endcode - where \p item is the item found, \p val is the find function argument. + where \p item is the item found, \p key is the find function argument. The functor may change non-key fields of \p item. Note that the functor is only guarantee that \p item cannot be disposed during functor is executing. The functor does not serialize simultaneous access to the set's \p item. If such access is possible you must provide your own synchronization schema on item level to exclude unsafe item modifications. - The \p val argument is non-const since it can be used as \p f functor destination i.e., the functor + The \p key argument is non-const since it can be used as \p f functor destination i.e., the functor can modify both arguments. Note the hash functor specified for class \p Traits template parameter @@ -471,15 +444,22 @@ namespace cds { namespace container { The function applies RCU lock internally. - The function returns \p true if \p val is found, \p false otherwise. + The function returns \p true if \p key is found, \p false otherwise. */ template - bool find( Q& val, Func f ) const + bool find( Q& key, Func f ) const + { + return base_class::find( key, [&f]( leaf_node& node, Q& v ) { f( node.m_Value, v ); }); + } + //@cond + template + bool find( Q const& key, Func f ) const { - return base_class::find( val, [&f]( leaf_node& node, Q& v ) { f( node.m_Value, v ); }); + return base_class::find( key, [&f]( leaf_node& node, Q const& v ) { f( node.m_Value, v ); } ); } + //@endcond - /// Finds the key \p val using \p pred predicate for searching + /// Finds the key \p key using \p pred predicate for searching /** The function is an analog of \ref cds_nonintrusive_EllenBinTreeSet_rcu_find_func "find(Q&, Func)" but \p pred is used for key comparing. @@ -487,60 +467,24 @@ namespace cds { namespace container { \p Less must imply the same element order as the comparator used for building the set. */ template - bool find_with( Q& val, Less pred, Func f ) const + bool find_with( Q& key, Less pred, Func f ) const { - return base_class::find_with( val, cds::details::predicate_wrapper< leaf_node, Less, typename maker::value_accessor >(), + return base_class::find_with( key, cds::details::predicate_wrapper< leaf_node, Less, typename maker::value_accessor >(), [&f]( leaf_node& node, Q& v ) { f( node.m_Value, v ); } ); } - - /// Find the key \p val - /** @anchor cds_nonintrusive_EllenBinTreeSet_rcu_find_cfunc - - The function searches the item with key equal to \p val and calls the functor \p f for item found. - The interface of \p Func functor is: - \code - struct functor { - void operator()( value_type& item, Q const& val ); - }; - \endcode - where \p item is the item found, \p val is the find function argument. - - The functor may change non-key fields of \p item. Note that the functor is only guarantee - that \p item cannot be disposed during functor is executing. - The functor does not serialize simultaneous access to the set's \p item. If such access is - possible you must provide your own synchronization schema on item level to exclude unsafe item modifications. - - Note the hash functor specified for class \p Traits template parameter - should accept a parameter of type \p Q that may be not the same as \p value_type. - - The function applies RCU lock internally. - - The function returns \p true if \p val is found, \p false otherwise. - */ - template - bool find( Q const& val, Func f ) const - { - return base_class::find( val, [&f]( leaf_node& node, Q const& v ) { f( node.m_Value, v ); }); - } - - /// Finds the key \p val using \p pred predicate for searching - /** - The function is an analog of \ref cds_nonintrusive_EllenBinTreeSet_rcu_find_cfunc "find(Q const&, Func)" - but \p pred is used for key comparing. - \p Less functor has the interface like \p std::less. - \p Less must imply the same element order as the comparator used for building the set. - */ + //@cond template - bool find_with( Q const& val, Less pred, Func f ) const + bool find_with( Q const& key, Less pred, Func f ) const { - return base_class::find_with( val, cds::details::predicate_wrapper< leaf_node, Less, typename maker::value_accessor >(), - [&f]( leaf_node& node, Q const& v ) { f( node.m_Value, v ); } ); + return base_class::find_with( key, cds::details::predicate_wrapper< leaf_node, Less, typename maker::value_accessor >(), + [&f]( leaf_node& node, Q const& v ) { f( node.m_Value, v ); } ); } + //@endcond - /// Find the key \p val + /// Find the key \p key /** @anchor cds_nonintrusive_EllenBinTreeSet_rcu_find_val - The function searches the item with key equal to \p val + The function searches the item with key equal to \p key and returns \p true if it is found, and \p false otherwise. Note the hash functor specified for class \p Traits template parameter @@ -549,12 +493,12 @@ namespace cds { namespace container { The function applies RCU lock internally. */ template - bool find( Q const & val ) const + bool find( Q const& key ) const { - return base_class::find( val ); + return base_class::find( key ); } - /// Finds the key \p val using \p pred predicate for searching + /// Finds the key \p key using \p pred predicate for searching /** The function is an analog of \ref cds_nonintrusive_EllenBinTreeSet_rcu_find_val "find(Q const&)" but \p pred is used for key comparing. @@ -562,9 +506,9 @@ namespace cds { namespace container { \p Less must imply the same element order as the comparator used for building the set. */ template - bool find_with( Q const& val, Less pred ) const + bool find_with( Q const& key, Less pred ) const { - return base_class::find_with( val, cds::details::predicate_wrapper< leaf_node, Less, typename maker::value_accessor >()); + return base_class::find_with( key, cds::details::predicate_wrapper< leaf_node, Less, typename maker::value_accessor >()); } /// Finds \p key and return the item found @@ -630,8 +574,8 @@ namespace cds { namespace container { Only leaf nodes containing user data are counted. The value returned depends on item counter type provided by \p Traits template parameter. - If it is atomicity::empty_item_counter this function always returns 0. - Therefore, the function is not suitable for checking the tree emptiness, use \ref empty + If it is \p atomicity::empty_item_counter \p %size() always returns 0. + Therefore, the function is not suitable for checking the tree emptiness, use \p empty() member function for this purpose. */ size_t size() const @@ -653,9 +597,7 @@ namespace cds { namespace container { { return base_class::check_consistency(); } - }; - }} // namespace cds::container #endif // #ifndef __CDS_CONTAINER_ELLEN_BINTREE_SET_RCU_H diff --git a/cds/container/impl/ellen_bintree_map.h b/cds/container/impl/ellen_bintree_map.h index 8f60db75..c8dab925 100644 --- a/cds/container/impl/ellen_bintree_map.h +++ b/cds/container/impl/ellen_bintree_map.h @@ -3,7 +3,7 @@ #ifndef __CDS_CONTAINER_IMPL_ELLEN_BINTREE_MAP_H #define __CDS_CONTAINER_IMPL_ELLEN_BINTREE_MAP_H -#include +#include #include #include #include @@ -85,7 +85,7 @@ namespace cds { namespace container { # ifdef CDS_DOXYGEN_INVOKED typedef implementation_defined key_comparator; ///< key compare functor based on \p Traits::compare and \p Traits::less # else - typedef typename maker::intrusive_type_traits::compare key_comparator; + typedef typename maker::intrusive_traits::compare key_comparator; # endif typedef typename base_class::item_counter item_counter; ///< Item counting policy typedef typename base_class::memory_model memory_model; ///< Memory ordering, see \p cds::opt::memory_model diff --git a/cds/container/impl/ellen_bintree_set.h b/cds/container/impl/ellen_bintree_set.h index 366ab1f0..13f75fb5 100644 --- a/cds/container/impl/ellen_bintree_set.h +++ b/cds/container/impl/ellen_bintree_set.h @@ -3,7 +3,7 @@ #ifndef __CDS_CONTAINER_IMPL_ELLEN_BINTREE_SET_H #define __CDS_CONTAINER_IMPL_ELLEN_BINTREE_SET_H -#include +#include #include #include #include @@ -123,7 +123,7 @@ namespace cds { namespace container { # ifdef CDS_DOXYGEN_INVOKED typedef implementation_defined key_comparator ; ///< key compare functor based on opt::compare and opt::less option setter. # else - typedef typename maker::intrusive_type_traits::compare key_comparator; + typedef typename maker::intrusive_traits::compare key_comparator; # endif typedef typename base_class::item_counter item_counter; ///< Item counting policy used typedef typename base_class::memory_model memory_model; ///< Memory ordering. See cds::opt::memory_model option diff --git a/cds/container/skip_list_map_nogc.h b/cds/container/skip_list_map_nogc.h index 4aa63eca..916de567 100644 --- a/cds/container/skip_list_map_nogc.h +++ b/cds/container/skip_list_map_nogc.h @@ -19,7 +19,6 @@ namespace cds { namespace container { }} // namespace skip_list::details //@endcond - /// Lock-free skip-list map (template specialization for gc::nogc) /** @ingroup cds_nonintrusive_map \anchor cds_nonintrusive_SkipListMap_nogc diff --git a/projects/Win/vc12/cds.vcxproj b/projects/Win/vc12/cds.vcxproj index b1d4c659..373bc40f 100644 --- a/projects/Win/vc12/cds.vcxproj +++ b/projects/Win/vc12/cds.vcxproj @@ -668,11 +668,11 @@ + - + - diff --git a/projects/Win/vc12/cds.vcxproj.filters b/projects/Win/vc12/cds.vcxproj.filters index 9e873d16..ef76ea7f 100644 --- a/projects/Win/vc12/cds.vcxproj.filters +++ b/projects/Win/vc12/cds.vcxproj.filters @@ -1052,15 +1052,9 @@ Header Files\cds\container - - Header Files\cds\container - Header Files\cds\container - - Header Files\cds\container - Header Files\cds\intrusive @@ -1232,5 +1226,11 @@ Header Files\cds\intrusive + + Header Files\cds\container + + + Header Files\cds\container + \ No newline at end of file diff --git a/projects/Win/vc12/hdr-test-tree.vcxproj b/projects/Win/vc12/hdr-test-tree.vcxproj index c21ab5c6..33ee01bb 100644 --- a/projects/Win/vc12/hdr-test-tree.vcxproj +++ b/projects/Win/vc12/hdr-test-tree.vcxproj @@ -543,15 +543,15 @@ + - + - diff --git a/projects/Win/vc12/hdr-test-tree.vcxproj.filters b/projects/Win/vc12/hdr-test-tree.vcxproj.filters index 343c96a1..fcdd4712 100644 --- a/projects/Win/vc12/hdr-test-tree.vcxproj.filters +++ b/projects/Win/vc12/hdr-test-tree.vcxproj.filters @@ -99,20 +99,20 @@ container - - container - container - - container - intrusive intrusive + + container + + + container + \ No newline at end of file diff --git a/projects/Win/vc12/unit-map-insdel.vcxproj b/projects/Win/vc12/unit-map-insdel.vcxproj index f9bc6e8d..3f1b634f 100644 --- a/projects/Win/vc12/unit-map-insdel.vcxproj +++ b/projects/Win/vc12/unit-map-insdel.vcxproj @@ -43,7 +43,6 @@ - diff --git a/tests/test-hdr/tree/hdr_ellenbintree_map.h b/tests/test-hdr/tree/hdr_ellenbintree_map.h index c087779c..d917bc8a 100644 --- a/tests/test-hdr/tree/hdr_ellenbintree_map.h +++ b/tests/test-hdr/tree/hdr_ellenbintree_map.h @@ -573,15 +573,15 @@ namespace tree { void EllenBinTree_hp_less_pool(); void EllenBinTree_hp_less_pool_ic_stat(); - void EllenBinTree_ptb_less(); - void EllenBinTree_ptb_cmp(); - void EllenBinTree_ptb_cmpless(); - void EllenBinTree_ptb_less_ic(); - void EllenBinTree_ptb_cmp_ic(); - void EllenBinTree_ptb_less_stat(); - void EllenBinTree_ptb_cmp_ic_stat(); - void EllenBinTree_ptb_less_pool(); - void EllenBinTree_ptb_less_pool_ic_stat(); + void EllenBinTree_dhp_less(); + void EllenBinTree_dhp_cmp(); + void EllenBinTree_dhp_cmpless(); + void EllenBinTree_dhp_less_ic(); + void EllenBinTree_dhp_cmp_ic(); + void EllenBinTree_dhp_less_stat(); + void EllenBinTree_dhp_cmp_ic_stat(); + void EllenBinTree_dhp_less_pool(); + void EllenBinTree_dhp_less_pool_ic_stat(); void EllenBinTree_rcu_gpb_less(); void EllenBinTree_rcu_gpb_cmp(); @@ -634,15 +634,15 @@ namespace tree { CPPUNIT_TEST(EllenBinTree_hp_less_pool) CPPUNIT_TEST(EllenBinTree_hp_less_pool_ic_stat) - CPPUNIT_TEST(EllenBinTree_ptb_less) - CPPUNIT_TEST(EllenBinTree_ptb_cmp) - CPPUNIT_TEST(EllenBinTree_ptb_less_stat) - CPPUNIT_TEST(EllenBinTree_ptb_cmpless) - CPPUNIT_TEST(EllenBinTree_ptb_less_ic) - CPPUNIT_TEST(EllenBinTree_ptb_cmp_ic) - CPPUNIT_TEST(EllenBinTree_ptb_cmp_ic_stat) - CPPUNIT_TEST(EllenBinTree_ptb_less_pool) - CPPUNIT_TEST(EllenBinTree_ptb_less_pool_ic_stat) + CPPUNIT_TEST(EllenBinTree_dhp_less) + CPPUNIT_TEST(EllenBinTree_dhp_cmp) + CPPUNIT_TEST(EllenBinTree_dhp_less_stat) + CPPUNIT_TEST(EllenBinTree_dhp_cmpless) + CPPUNIT_TEST(EllenBinTree_dhp_less_ic) + CPPUNIT_TEST(EllenBinTree_dhp_cmp_ic) + CPPUNIT_TEST(EllenBinTree_dhp_cmp_ic_stat) + CPPUNIT_TEST(EllenBinTree_dhp_less_pool) + CPPUNIT_TEST(EllenBinTree_dhp_less_pool_ic_stat) CPPUNIT_TEST(EllenBinTree_rcu_gpi_less) CPPUNIT_TEST(EllenBinTree_rcu_gpi_cmp) diff --git a/tests/test-hdr/tree/hdr_ellenbintree_map_ptb.cpp b/tests/test-hdr/tree/hdr_ellenbintree_map_dhp.cpp similarity index 81% rename from tests/test-hdr/tree/hdr_ellenbintree_map_ptb.cpp rename to tests/test-hdr/tree/hdr_ellenbintree_map_dhp.cpp index 3fef81b3..3145e085 100644 --- a/tests/test-hdr/tree/hdr_ellenbintree_map_ptb.cpp +++ b/tests/test-hdr/tree/hdr_ellenbintree_map_dhp.cpp @@ -1,7 +1,7 @@ //$$CDS-header$$ #include "tree/hdr_ellenbintree_map.h" -#include +#include #include "tree/hdr_intrusive_ellen_bintree_pool_dhp.h" #include "unit/print_ellenbintree_stat.h" @@ -10,9 +10,9 @@ namespace tree { namespace cc = cds::container; namespace co = cds::opt; namespace { - typedef cds::gc::PTB gc_type; + typedef cds::gc::DHP gc_type; - typedef cc::ellen_bintree::map_node tree_leaf_node; + typedef cc::ellen_bintree::map_node tree_leaf_node; typedef cc::ellen_bintree::internal_node< EllenBinTreeMapHdrTest::key_type, tree_leaf_node > tree_internal_node; typedef cc::ellen_bintree::update_desc tree_update_desc; @@ -26,18 +26,18 @@ namespace tree { } - void EllenBinTreeMapHdrTest::EllenBinTree_ptb_less() + void EllenBinTreeMapHdrTest::EllenBinTree_dhp_less() { - typedef cc::EllenBinTreeMap< gc_type, key_type, value_type, - cc::ellen_bintree::make_map_traits< - co::less< less > - >::type - > set_type; + struct map_traits : public cc::ellen_bintree::traits + { + typedef EllenBinTreeMapHdrTest::less less; + }; + typedef cc::EllenBinTreeMap< gc_type, key_type, value_type, map_traits > set_type; test(); } - void EllenBinTreeMapHdrTest::EllenBinTree_ptb_cmp() + void EllenBinTreeMapHdrTest::EllenBinTree_dhp_cmp() { typedef cc::EllenBinTreeMap< gc_type, key_type, value_type, cc::ellen_bintree::make_map_traits< @@ -48,7 +48,7 @@ namespace tree { test(); } - void EllenBinTreeMapHdrTest::EllenBinTree_ptb_cmpless() + void EllenBinTreeMapHdrTest::EllenBinTree_dhp_cmpless() { typedef cc::EllenBinTreeMap< gc_type, key_type, value_type, cc::ellen_bintree::make_map_traits< @@ -60,7 +60,7 @@ namespace tree { test(); } - void EllenBinTreeMapHdrTest::EllenBinTree_ptb_less_ic() + void EllenBinTreeMapHdrTest::EllenBinTree_dhp_less_ic() { typedef cc::EllenBinTreeMap< gc_type, key_type, value_type, cc::ellen_bintree::make_map_traits< @@ -72,7 +72,7 @@ namespace tree { test(); } - void EllenBinTreeMapHdrTest::EllenBinTree_ptb_cmp_ic() + void EllenBinTreeMapHdrTest::EllenBinTree_dhp_cmp_ic() { typedef cc::EllenBinTreeMap< gc_type, key_type, value_type, cc::ellen_bintree::make_map_traits< @@ -84,7 +84,7 @@ namespace tree { test(); } - void EllenBinTreeMapHdrTest::EllenBinTree_ptb_less_stat() + void EllenBinTreeMapHdrTest::EllenBinTree_dhp_less_stat() { typedef cc::EllenBinTreeMap< gc_type, key_type, value_type, cc::ellen_bintree::make_map_traits< @@ -96,7 +96,7 @@ namespace tree { test(); } - void EllenBinTreeMapHdrTest::EllenBinTree_ptb_cmp_ic_stat() + void EllenBinTreeMapHdrTest::EllenBinTree_dhp_cmp_ic_stat() { typedef cc::EllenBinTreeMap< gc_type, key_type, value_type, cc::ellen_bintree::make_map_traits< @@ -109,7 +109,7 @@ namespace tree { test(); } - void EllenBinTreeMapHdrTest::EllenBinTree_ptb_less_pool() + void EllenBinTreeMapHdrTest::EllenBinTree_dhp_less_pool() { typedef cc::EllenBinTreeMap< gc_type, key_type, value_type, cc::ellen_bintree::make_map_traits< @@ -122,7 +122,7 @@ namespace tree { test(); } - void EllenBinTreeMapHdrTest::EllenBinTree_ptb_less_pool_ic_stat() + void EllenBinTreeMapHdrTest::EllenBinTree_dhp_less_pool_ic_stat() { typedef cc::EllenBinTreeMap< gc_type, key_type, value_type, cc::ellen_bintree::make_map_traits< diff --git a/tests/test-hdr/tree/hdr_ellenbintree_map_hp.cpp b/tests/test-hdr/tree/hdr_ellenbintree_map_hp.cpp index 4b27b8fb..81201123 100644 --- a/tests/test-hdr/tree/hdr_ellenbintree_map_hp.cpp +++ b/tests/test-hdr/tree/hdr_ellenbintree_map_hp.cpp @@ -12,7 +12,7 @@ namespace tree { namespace { typedef cds::gc::HP gc_type; - typedef cc::ellen_bintree::map_node tree_leaf_node; + typedef cc::ellen_bintree::map_node tree_leaf_node; typedef cc::ellen_bintree::internal_node< EllenBinTreeMapHdrTest::key_type, tree_leaf_node > tree_internal_node; typedef cc::ellen_bintree::update_desc tree_update_desc; @@ -28,11 +28,11 @@ namespace tree { void EllenBinTreeMapHdrTest::EllenBinTree_hp_less() { - typedef cc::EllenBinTreeMap< gc_type, key_type, value_type, - cc::ellen_bintree::make_map_traits< - co::less< less > - >::type - > set_type; + struct set_traits : public cc::ellen_bintree::traits + { + typedef EllenBinTreeMapHdrTest::less less; + }; + typedef cc::EllenBinTreeMap< gc_type, key_type, value_type, set_traits > set_type; test(); } diff --git a/tests/test-hdr/tree/hdr_ellenbintree_map_rcu_gpb.cpp b/tests/test-hdr/tree/hdr_ellenbintree_map_rcu_gpb.cpp index f72e6105..6a7bdc53 100644 --- a/tests/test-hdr/tree/hdr_ellenbintree_map_rcu_gpb.cpp +++ b/tests/test-hdr/tree/hdr_ellenbintree_map_rcu_gpb.cpp @@ -33,9 +33,9 @@ namespace tree { cc::ellen_bintree::make_map_traits< co::less< less > >::type - > set_type; + > map_type; - test_rcu(); + test_rcu(); } void EllenBinTreeMapHdrTest::EllenBinTree_rcu_gpb_cmp() @@ -44,9 +44,9 @@ namespace tree { cc::ellen_bintree::make_map_traits< co::compare< compare > >::type - > set_type; + > map_type; - test_rcu(); + test_rcu(); } void EllenBinTreeMapHdrTest::EllenBinTree_rcu_gpb_cmpless() @@ -56,9 +56,9 @@ namespace tree { co::compare< compare > ,co::less< less > >::type - > set_type; + > map_type; - test_rcu(); + test_rcu(); } void EllenBinTreeMapHdrTest::EllenBinTree_rcu_gpb_less_ic() @@ -68,21 +68,20 @@ namespace tree { co::less< less > ,co::item_counter< cds::atomicity::item_counter > >::type - > set_type; + > map_type; - test_rcu(); + test_rcu(); } void EllenBinTreeMapHdrTest::EllenBinTree_rcu_gpb_cmp_ic() { - typedef cc::EllenBinTreeMap< rcu_type, key_type, value_type, - cc::ellen_bintree::make_map_traits< - co::item_counter< cds::atomicity::item_counter > - ,co::compare< compare > - >::type - > set_type; + struct map_traits : public cc::ellen_bintree::traits { + typedef cds::atomicity::item_counter item_counter; + typedef EllenBinTreeMapHdrTest::compare compare; + }; + typedef cc::EllenBinTreeMap< rcu_type, key_type, value_type, map_traits > map_type; - test_rcu(); + test_rcu(); } void EllenBinTreeMapHdrTest::EllenBinTree_rcu_gpb_less_stat() @@ -92,9 +91,9 @@ namespace tree { co::less< less > ,co::stat< cc::ellen_bintree::stat<> > >::type - > set_type; + > map_type; - test_rcu(); + test_rcu(); } void EllenBinTreeMapHdrTest::EllenBinTree_rcu_gpb_cmp_ic_stat() @@ -105,9 +104,9 @@ namespace tree { ,co::stat< cc::ellen_bintree::stat<> > ,co::compare< compare > >::type - > set_type; + > map_type; - test_rcu(); + test_rcu(); } void EllenBinTreeMapHdrTest::EllenBinTree_rcu_gpb_less_pool() @@ -118,9 +117,9 @@ namespace tree { ,co::node_allocator< cds::memory::pool_allocator< tree_internal_node, ellen_bintree_rcu::internal_node_pool_accessor > > ,cc::ellen_bintree::update_desc_allocator< cds::memory::pool_allocator< tree_update_desc, ellen_bintree_rcu::update_desc_pool_accessor > > >::type - > set_type; + > map_type; - test_rcu(); + test_rcu(); } void EllenBinTreeMapHdrTest::EllenBinTree_rcu_gpb_less_pool_ic_stat() @@ -133,9 +132,9 @@ namespace tree { ,co::item_counter< cds::atomicity::item_counter > ,co::stat< cc::ellen_bintree::stat<> > >::type - > set_type; + > map_type; - test_rcu(); + test_rcu(); } } // namespace tree diff --git a/tests/test-hdr/tree/hdr_ellenbintree_set.h b/tests/test-hdr/tree/hdr_ellenbintree_set.h index 24c11647..8d80b66d 100644 --- a/tests/test-hdr/tree/hdr_ellenbintree_set.h +++ b/tests/test-hdr/tree/hdr_ellenbintree_set.h @@ -662,15 +662,15 @@ namespace tree { void EllenBinTree_hp_less_pool(); void EllenBinTree_hp_less_pool_ic_stat(); - void EllenBinTree_ptb_less(); - void EllenBinTree_ptb_cmp(); - void EllenBinTree_ptb_cmpless(); - void EllenBinTree_ptb_less_ic(); - void EllenBinTree_ptb_cmp_ic(); - void EllenBinTree_ptb_less_stat(); - void EllenBinTree_ptb_cmp_ic_stat(); - void EllenBinTree_ptb_less_pool(); - void EllenBinTree_ptb_less_pool_ic_stat(); + void EllenBinTree_dhp_less(); + void EllenBinTree_dhp_cmp(); + void EllenBinTree_dhp_cmpless(); + void EllenBinTree_dhp_less_ic(); + void EllenBinTree_dhp_cmp_ic(); + void EllenBinTree_dhp_less_stat(); + void EllenBinTree_dhp_cmp_ic_stat(); + void EllenBinTree_dhp_less_pool(); + void EllenBinTree_dhp_less_pool_ic_stat(); void EllenBinTree_rcu_gpi_less(); void EllenBinTree_rcu_gpi_cmp(); @@ -733,15 +733,15 @@ namespace tree { CPPUNIT_TEST(EllenBinTree_hp_less_pool) CPPUNIT_TEST(EllenBinTree_hp_less_pool_ic_stat) - CPPUNIT_TEST(EllenBinTree_ptb_less) - CPPUNIT_TEST(EllenBinTree_ptb_cmp) - CPPUNIT_TEST(EllenBinTree_ptb_less_stat) - CPPUNIT_TEST(EllenBinTree_ptb_cmpless) - CPPUNIT_TEST(EllenBinTree_ptb_less_ic) - CPPUNIT_TEST(EllenBinTree_ptb_cmp_ic) - CPPUNIT_TEST(EllenBinTree_ptb_cmp_ic_stat) - CPPUNIT_TEST(EllenBinTree_ptb_less_pool) - CPPUNIT_TEST(EllenBinTree_ptb_less_pool_ic_stat) + CPPUNIT_TEST(EllenBinTree_dhp_less) + CPPUNIT_TEST(EllenBinTree_dhp_cmp) + CPPUNIT_TEST(EllenBinTree_dhp_less_stat) + CPPUNIT_TEST(EllenBinTree_dhp_cmpless) + CPPUNIT_TEST(EllenBinTree_dhp_less_ic) + CPPUNIT_TEST(EllenBinTree_dhp_cmp_ic) + CPPUNIT_TEST(EllenBinTree_dhp_cmp_ic_stat) + CPPUNIT_TEST(EllenBinTree_dhp_less_pool) + CPPUNIT_TEST(EllenBinTree_dhp_less_pool_ic_stat) CPPUNIT_TEST(EllenBinTree_rcu_gpi_less) CPPUNIT_TEST(EllenBinTree_rcu_gpi_cmp) diff --git a/tests/test-hdr/tree/hdr_ellenbintree_set_ptb.cpp b/tests/test-hdr/tree/hdr_ellenbintree_set_dhp.cpp similarity index 83% rename from tests/test-hdr/tree/hdr_ellenbintree_set_ptb.cpp rename to tests/test-hdr/tree/hdr_ellenbintree_set_dhp.cpp index d5bef869..cdabe215 100644 --- a/tests/test-hdr/tree/hdr_ellenbintree_set_ptb.cpp +++ b/tests/test-hdr/tree/hdr_ellenbintree_set_dhp.cpp @@ -1,7 +1,7 @@ //$$CDS-header$$ #include "tree/hdr_ellenbintree_set.h" -#include +#include #include "tree/hdr_intrusive_ellen_bintree_pool_dhp.h" #include "unit/print_ellenbintree_stat.h" @@ -10,7 +10,7 @@ namespace tree { namespace cc = cds::container; namespace co = cds::opt; namespace { - typedef cds::gc::PTB gc_type; + typedef cds::gc::DHP gc_type; typedef cc::ellen_bintree::node tree_leaf_node; typedef cc::ellen_bintree::internal_node< EllenBinTreeSetHdrTest::key_type, tree_leaf_node > tree_internal_node; @@ -26,19 +26,18 @@ namespace tree { } - void EllenBinTreeSetHdrTest::EllenBinTree_ptb_less() + void EllenBinTreeSetHdrTest::EllenBinTree_dhp_less() { - typedef cc::EllenBinTreeSet< gc_type, key_type, value_type, - cc::ellen_bintree::make_set_traits< - cc::ellen_bintree::key_extractor< key_extractor > - ,co::less< less > - >::type - > set_type; + struct set_traits: public cc::ellen_bintree::traits{ + typedef EllenBinTreeSetHdrTest::key_extractor key_extractor; + typedef EllenBinTreeSetHdrTest::less less; + }; + typedef cc::EllenBinTreeSet< gc_type, key_type, value_type, set_traits > set_type; test(); } - void EllenBinTreeSetHdrTest::EllenBinTree_ptb_cmp() + void EllenBinTreeSetHdrTest::EllenBinTree_dhp_cmp() { typedef cc::EllenBinTreeSet< gc_type, key_type, value_type, cc::ellen_bintree::make_set_traits< @@ -50,7 +49,7 @@ namespace tree { test(); } - void EllenBinTreeSetHdrTest::EllenBinTree_ptb_cmpless() + void EllenBinTreeSetHdrTest::EllenBinTree_dhp_cmpless() { typedef cc::EllenBinTreeSet< gc_type, key_type, value_type, cc::ellen_bintree::make_set_traits< @@ -63,7 +62,7 @@ namespace tree { test(); } - void EllenBinTreeSetHdrTest::EllenBinTree_ptb_less_ic() + void EllenBinTreeSetHdrTest::EllenBinTree_dhp_less_ic() { typedef cc::EllenBinTreeSet< gc_type, key_type, value_type, cc::ellen_bintree::make_set_traits< @@ -76,7 +75,7 @@ namespace tree { test(); } - void EllenBinTreeSetHdrTest::EllenBinTree_ptb_cmp_ic() + void EllenBinTreeSetHdrTest::EllenBinTree_dhp_cmp_ic() { typedef cc::EllenBinTreeSet< gc_type, key_type, value_type, cc::ellen_bintree::make_set_traits< @@ -89,7 +88,7 @@ namespace tree { test(); } - void EllenBinTreeSetHdrTest::EllenBinTree_ptb_less_stat() + void EllenBinTreeSetHdrTest::EllenBinTree_dhp_less_stat() { typedef cc::EllenBinTreeSet< gc_type, key_type, value_type, cc::ellen_bintree::make_set_traits< @@ -102,7 +101,7 @@ namespace tree { test(); } - void EllenBinTreeSetHdrTest::EllenBinTree_ptb_cmp_ic_stat() + void EllenBinTreeSetHdrTest::EllenBinTree_dhp_cmp_ic_stat() { typedef cc::EllenBinTreeSet< gc_type, key_type, value_type, cc::ellen_bintree::make_set_traits< @@ -116,7 +115,7 @@ namespace tree { test(); } - void EllenBinTreeSetHdrTest::EllenBinTree_ptb_less_pool() + void EllenBinTreeSetHdrTest::EllenBinTree_dhp_less_pool() { typedef cc::EllenBinTreeSet< gc_type, key_type, value_type, cc::ellen_bintree::make_set_traits< @@ -130,7 +129,7 @@ namespace tree { test(); } - void EllenBinTreeSetHdrTest::EllenBinTree_ptb_less_pool_ic_stat() + void EllenBinTreeSetHdrTest::EllenBinTree_dhp_less_pool_ic_stat() { typedef cc::EllenBinTreeSet< gc_type, key_type, value_type, cc::ellen_bintree::make_set_traits< diff --git a/tests/test-hdr/tree/hdr_ellenbintree_set_hp.cpp b/tests/test-hdr/tree/hdr_ellenbintree_set_hp.cpp index 9f0a3776..582ef7ee 100644 --- a/tests/test-hdr/tree/hdr_ellenbintree_set_hp.cpp +++ b/tests/test-hdr/tree/hdr_ellenbintree_set_hp.cpp @@ -23,17 +23,15 @@ namespace tree { std::cout << t.statistics(); } }; - } void EllenBinTreeSetHdrTest::EllenBinTree_hp_less() { - typedef cc::EllenBinTreeSet< gc_type, key_type, value_type, - cc::ellen_bintree::make_set_traits< - cc::ellen_bintree::key_extractor< key_extractor > - ,co::less< less > - >::type - > set_type; + struct set_traits : public cc::ellen_bintree::traits{ + typedef EllenBinTreeSetHdrTest::key_extractor key_extractor; + typedef EllenBinTreeSetHdrTest::less less; + }; + typedef cc::EllenBinTreeSet< gc_type, key_type, value_type, set_traits > set_type; test(); } diff --git a/tests/test-hdr/tree/hdr_ellenbintree_set_rcu_gpb.cpp b/tests/test-hdr/tree/hdr_ellenbintree_set_rcu_gpb.cpp index c91a4417..063dfb61 100644 --- a/tests/test-hdr/tree/hdr_ellenbintree_set_rcu_gpb.cpp +++ b/tests/test-hdr/tree/hdr_ellenbintree_set_rcu_gpb.cpp @@ -24,17 +24,15 @@ namespace tree { std::cout << t.statistics(); } }; - } void EllenBinTreeSetHdrTest::EllenBinTree_rcu_gpb_less() { - typedef cc::EllenBinTreeSet< rcu_type, key_type, value_type, - cc::ellen_bintree::make_set_traits< - cc::ellen_bintree::key_extractor< key_extractor > - ,co::less< less > - >::type - > set_type; + struct set_traits : public cc::ellen_bintree::traits{ + typedef EllenBinTreeSetHdrTest::key_extractor key_extractor; + typedef EllenBinTreeSetHdrTest::less less; + }; + typedef cc::EllenBinTreeSet< rcu_type, key_type, value_type, set_traits > set_type; test_rcu(); } diff --git a/tests/unit/map2/map_defs.h b/tests/unit/map2/map_defs.h index 5b83fa54..a9c2f028 100644 --- a/tests/unit/map2/map_defs.h +++ b/tests/unit/map2/map_defs.h @@ -404,8 +404,8 @@ TEST_MAP_EXTRACT(SplitList_Lazy_RCU_SHT_st_less_stat) #define CDSUNIT_DECLARE_EllenBinTreeMap \ TEST_MAP_NOLF_EXTRACT(EllenBinTreeMap_hp)\ TEST_MAP_NOLF_EXTRACT(EllenBinTreeMap_hp_stat)\ - TEST_MAP_NOLF_EXTRACT(EllenBinTreeMap_ptb)\ - TEST_MAP_NOLF_EXTRACT(EllenBinTreeMap_ptb_stat)\ + TEST_MAP_NOLF_EXTRACT(EllenBinTreeMap_dhp)\ + TEST_MAP_NOLF_EXTRACT(EllenBinTreeMap_dhp_stat)\ TEST_MAP_NOLF_EXTRACT(EllenBinTreeMap_rcu_gpi)\ TEST_MAP_NOLF_EXTRACT(EllenBinTreeMap_rcu_gpi_stat)\ TEST_MAP_NOLF_EXTRACT(EllenBinTreeMap_rcu_gpb)\ @@ -417,8 +417,8 @@ TEST_MAP_EXTRACT(SplitList_Lazy_RCU_SHT_st_less_stat) #define CDSUNIT_TEST_EllenBinTreeMap \ CPPUNIT_TEST(EllenBinTreeMap_hp)\ CPPUNIT_TEST(EllenBinTreeMap_hp_stat)\ - CPPUNIT_TEST(EllenBinTreeMap_ptb)\ - CPPUNIT_TEST(EllenBinTreeMap_ptb_stat)\ + CPPUNIT_TEST(EllenBinTreeMap_dhp)\ + CPPUNIT_TEST(EllenBinTreeMap_dhp_stat)\ CPPUNIT_TEST(EllenBinTreeMap_rcu_gpi)\ CPPUNIT_TEST(EllenBinTreeMap_rcu_gpi_stat)\ CPPUNIT_TEST(EllenBinTreeMap_rcu_gpb)\ diff --git a/tests/unit/map2/map_types.h b/tests/unit/map2/map_types.h index de8f106b..0050f73b 100644 --- a/tests/unit/map2/map_types.h +++ b/tests/unit/map2/map_types.h @@ -39,7 +39,7 @@ #include #include -#include +#include #include #if BOOST_VERSION >= 104800 @@ -1645,7 +1645,7 @@ namespace map2 { typedef cc::ellen_bintree::internal_node< Key, leaf_node > internal_node; typedef cc::ellen_bintree::update_desc< leaf_node, internal_node > update_desc; }; - struct ptb_gc { + struct dhp_gc { typedef cc::ellen_bintree::map_node leaf_node; typedef cc::ellen_bintree::internal_node< Key, leaf_node > internal_node; typedef cc::ellen_bintree::update_desc< leaf_node, internal_node > update_desc; @@ -1679,181 +1679,104 @@ namespace map2 { #endif }; - - // *************************************************************************** - // EllenBinTreeMap - HP - - struct traits_EllenBinTreeMap_hp: public cc::ellen_bintree::make_set_traits< + struct traits_EllenBinTreeMap: public cc::ellen_bintree::make_set_traits< co::less< less > - ,cc::ellen_bintree::update_desc_allocator< - cds::memory::pool_allocator< typename ellen_bintree_props::hp_gc::update_desc, ellen_bintree_pool::update_desc_pool_accessor > - > ,co::node_allocator< ellen_bintree_pool::internal_node_allocator< int > > ,co::item_counter< cds::atomicity::item_counter > >::type {}; + struct traits_EllenBinTreeMap_hp : traits_EllenBinTreeMap { + typedef cds::memory::pool_allocator< typename ellen_bintree_props::hp_gc::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator; + }; typedef cc::EllenBinTreeMap< cds::gc::HP, Key, Value, traits_EllenBinTreeMap_hp >EllenBinTreeMap_hp; - struct traits_EllenBinTreeMap_hp_stat: public cc::ellen_bintree::make_set_traits< - co::less< less > - ,cc::ellen_bintree::update_desc_allocator< - cds::memory::pool_allocator< typename ellen_bintree_props::hp_gc::update_desc, ellen_bintree_pool::update_desc_pool_accessor > - > - ,co::node_allocator< ellen_bintree_pool::internal_node_allocator< int > > - ,co::stat< cc::ellen_bintree::stat<> > - ,co::item_counter< cds::atomicity::item_counter > - >::type - {}; - typedef cc::EllenBinTreeMap< cds::gc::HP, Key, Value, traits_EllenBinTreeMap_hp_stat > EllenBinTreeMap_hp_stat; - - // *************************************************************************** - // EllenBinTreeMap - DHP - - struct traits_EllenBinTreeMap_ptb: public cc::ellen_bintree::make_set_traits< - co::less< less > - ,cc::ellen_bintree::update_desc_allocator< - cds::memory::pool_allocator< typename ellen_bintree_props::ptb_gc::update_desc, ellen_bintree_pool::update_desc_pool_accessor > - > - ,co::node_allocator< ellen_bintree_pool::internal_node_allocator< int > > - ,co::item_counter< cds::atomicity::item_counter > - >::type - {}; - typedef cc::EllenBinTreeMap< cds::gc::DHP, Key, Value, traits_EllenBinTreeMap_ptb> EllenBinTreeMap_ptb; + struct traits_EllenBinTreeMap_dhp : traits_EllenBinTreeMap { + typedef cds::memory::pool_allocator< typename ellen_bintree_props::dhp_gc::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator; + }; + typedef cc::EllenBinTreeMap< cds::gc::DHP, Key, Value, traits_EllenBinTreeMap_dhp >EllenBinTreeMap_dhp; - struct traits_EllenBinTreeMap_ptb_stat: public cc::ellen_bintree::make_set_traits< - co::less< less > - ,cc::ellen_bintree::update_desc_allocator< - cds::memory::pool_allocator< typename ellen_bintree_props::ptb_gc::update_desc, ellen_bintree_pool::update_desc_pool_accessor > - > - ,co::node_allocator< ellen_bintree_pool::internal_node_allocator< int > > - ,co::stat< cc::ellen_bintree::stat<> > - ,co::item_counter< cds::atomicity::item_counter > - >::type - {}; - typedef cc::EllenBinTreeMap< cds::gc::DHP, Key, Value, traits_EllenBinTreeMap_ptb_stat > EllenBinTreeMap_ptb_stat; + struct traits_EllenBinTreeMap_gpi : traits_EllenBinTreeMap { + typedef cds::memory::pool_allocator< typename ellen_bintree_props::gpi::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator; + }; + typedef cc::EllenBinTreeMap< rcu_gpi, Key, Value, traits_EllenBinTreeMap_gpi >EllenBinTreeMap_rcu_gpi; - // *************************************************************************** - // EllenBinTreeMap - RCU + struct traits_EllenBinTreeMap_gpb : traits_EllenBinTreeMap { + typedef cds::memory::pool_allocator< typename ellen_bintree_props::gpb::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator; + }; + typedef cc::EllenBinTreeMap< rcu_gpb, Key, Value, traits_EllenBinTreeMap_gpb >EllenBinTreeMap_rcu_gpb; - struct traits_EllenBinTreeMap_rcu_gpi: public cc::ellen_bintree::make_set_traits< - co::less< less > - ,cc::ellen_bintree::update_desc_allocator< - cds::memory::pool_allocator< typename ellen_bintree_props::gpi::update_desc, ellen_bintree_pool::bounded_update_desc_pool_accessor > - > - ,co::node_allocator< ellen_bintree_pool::internal_node_allocator< int > > - ,co::item_counter< cds::atomicity::item_counter > - >::type - {}; - typedef cc::EllenBinTreeMap< rcu_gpi, Key, Value, traits_EllenBinTreeMap_rcu_gpi > EllenBinTreeMap_rcu_gpi; + struct traits_EllenBinTreeMap_gpt : traits_EllenBinTreeMap { + typedef cds::memory::pool_allocator< typename ellen_bintree_props::gpt::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator; + }; + typedef cc::EllenBinTreeMap< rcu_gpt, Key, Value, traits_EllenBinTreeMap_gpt >EllenBinTreeMap_rcu_gpt; - struct traits_EllenBinTreeMap_rcu_gpi_stat: public cc::ellen_bintree::make_set_traits< - co::less< less > - ,cc::ellen_bintree::update_desc_allocator< - cds::memory::pool_allocator< typename ellen_bintree_props::gpi::update_desc, ellen_bintree_pool::bounded_update_desc_pool_accessor > - > - ,co::node_allocator< ellen_bintree_pool::internal_node_allocator< int > > - ,co::stat< cc::ellen_bintree::stat<> > - ,co::item_counter< cds::atomicity::item_counter > - >::type - {}; - typedef cc::EllenBinTreeMap< rcu_gpi, Key, Value, traits_EllenBinTreeMap_rcu_gpi_stat > EllenBinTreeMap_rcu_gpi_stat; +#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED + struct traits_EllenBinTreeMap_shb : traits_EllenBinTreeMap { + typedef cds::memory::pool_allocator< typename ellen_bintree_props::shb::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator; + }; + typedef cc::EllenBinTreeMap< rcu_shb, Key, Value, traits_EllenBinTreeMap_shb >EllenBinTreeMap_rcu_shb; - struct traits_EllenBinTreeMap_rcu_gpb: public cc::ellen_bintree::make_set_traits< - co::less< less > - ,cc::ellen_bintree::update_desc_allocator< - cds::memory::pool_allocator< typename ellen_bintree_props::gpb::update_desc, ellen_bintree_pool::update_desc_pool_accessor > - > - ,co::node_allocator< ellen_bintree_pool::internal_node_allocator< int > > - ,co::item_counter< cds::atomicity::item_counter > - >::type - {}; - typedef cc::EllenBinTreeMap< rcu_gpb, Key, Value, traits_EllenBinTreeMap_rcu_gpb > EllenBinTreeMap_rcu_gpb; + struct traits_EllenBinTreeMap_sht : traits_EllenBinTreeMap { + typedef cds::memory::pool_allocator< typename ellen_bintree_props::sht::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator; + }; + typedef cc::EllenBinTreeMap< rcu_sht, Key, Value, traits_EllenBinTreeMap_sht >EllenBinTreeMap_rcu_sht; +#endif - struct traits_EllenBinTreeMap_rcu_gpb_stat: public cc::ellen_bintree::make_set_traits< + struct traits_EllenBinTreeMap_stat: public cc::ellen_bintree::make_set_traits< co::less< less > ,cc::ellen_bintree::update_desc_allocator< - cds::memory::pool_allocator< typename ellen_bintree_props::gpb::update_desc, ellen_bintree_pool::update_desc_pool_accessor > + cds::memory::pool_allocator< typename ellen_bintree_props::hp_gc::update_desc, ellen_bintree_pool::update_desc_pool_accessor > > ,co::node_allocator< ellen_bintree_pool::internal_node_allocator< int > > ,co::stat< cc::ellen_bintree::stat<> > ,co::item_counter< cds::atomicity::item_counter > >::type {}; - typedef cc::EllenBinTreeMap< rcu_gpb, Key, Value, traits_EllenBinTreeMap_rcu_gpb_stat > EllenBinTreeMap_rcu_gpb_stat; - struct traits_EllenBinTreeMap_rcu_gpt: public cc::ellen_bintree::make_set_traits< - co::less< less > - ,cc::ellen_bintree::update_desc_allocator< - cds::memory::pool_allocator< typename ellen_bintree_props::gpt::update_desc, ellen_bintree_pool::update_desc_pool_accessor > - > - ,co::node_allocator< ellen_bintree_pool::internal_node_allocator< int > > - ,co::item_counter< cds::atomicity::item_counter > - >::type - {}; - typedef cc::EllenBinTreeMap< rcu_gpt, Key, Value, traits_EllenBinTreeMap_rcu_gpt > EllenBinTreeMap_rcu_gpt; + struct traits_EllenBinTreeMap_stat_hp : public traits_EllenBinTreeMap_stat + { + typedef cds::memory::pool_allocator< typename ellen_bintree_props::hp_gc::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator; + }; + typedef cc::EllenBinTreeMap< cds::gc::HP, Key, Value, traits_EllenBinTreeMap_stat_hp > EllenBinTreeMap_hp_stat; - struct traits_EllenBinTreeMap_rcu_gpt_stat: public cc::ellen_bintree::make_set_traits< - co::less< less > - ,cc::ellen_bintree::update_desc_allocator< - cds::memory::pool_allocator< typename ellen_bintree_props::gpt::update_desc, ellen_bintree_pool::update_desc_pool_accessor > - > - ,co::node_allocator< ellen_bintree_pool::internal_node_allocator< int > > - ,co::stat< cc::ellen_bintree::stat<> > - ,co::item_counter< cds::atomicity::item_counter > - >::type - {}; - typedef cc::EllenBinTreeMap< rcu_gpt, Key, Value, traits_EllenBinTreeMap_rcu_gpt_stat > EllenBinTreeMap_rcu_gpt_stat; + struct traits_EllenBinTreeMap_stat_dhp : public traits_EllenBinTreeMap_stat + { + typedef cds::memory::pool_allocator< typename ellen_bintree_props::dhp_gc::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator; + }; + typedef cc::EllenBinTreeMap< cds::gc::HP, Key, Value, traits_EllenBinTreeMap_stat_dhp > EllenBinTreeMap_dhp_stat; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - struct traits_EllenBinTreeMap_rcu_shb: public cc::ellen_bintree::make_set_traits< - co::less< less > - ,cc::ellen_bintree::update_desc_allocator< - cds::memory::pool_allocator< typename ellen_bintree_props::shb::update_desc, ellen_bintree_pool::update_desc_pool_accessor > - > - ,co::node_allocator< ellen_bintree_pool::internal_node_allocator< int > > - ,co::item_counter< cds::atomicity::item_counter > - >::type - {}; - typedef cc::EllenBinTreeMap< rcu_shb, Key, Value, traits_EllenBinTreeMap_rcu_shb > EllenBinTreeMap_rcu_shb; + struct traits_EllenBinTreeMap_stat_gpi : public traits_EllenBinTreeMap_stat + { + typedef cds::memory::pool_allocator< typename ellen_bintree_props::gpi::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator; + }; + typedef cc::EllenBinTreeMap< rcu_gpi, Key, Value, traits_EllenBinTreeMap_stat_gpi > EllenBinTreeMap_rcu_gpi_stat; - struct traits_EllenBinTreeMap_rcu_shb_stat: public cc::ellen_bintree::make_set_traits< - co::less< less > - ,cc::ellen_bintree::update_desc_allocator< - cds::memory::pool_allocator< typename ellen_bintree_props::shb::update_desc, ellen_bintree_pool::update_desc_pool_accessor > - > - ,co::node_allocator< ellen_bintree_pool::internal_node_allocator< int > > - ,co::item_counter< cds::atomicity::item_counter > - ,co::stat< cc::ellen_bintree::stat<> > - >::type - {}; - typedef cc::EllenBinTreeMap< rcu_shb, Key, Value, traits_EllenBinTreeMap_rcu_shb_stat > EllenBinTreeMap_rcu_shb_stat; + struct traits_EllenBinTreeMap_stat_gpb : public traits_EllenBinTreeMap_stat + { + typedef cds::memory::pool_allocator< typename ellen_bintree_props::gpb::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator; + }; + typedef cc::EllenBinTreeMap< rcu_gpb, Key, Value, traits_EllenBinTreeMap_stat_gpb > EllenBinTreeMap_rcu_gpb_stat; - struct traits_EllenBinTreeMap_rcu_sht: public cc::ellen_bintree::make_set_traits< - co::less< less > - ,cc::ellen_bintree::update_desc_allocator< - cds::memory::pool_allocator< typename ellen_bintree_props::sht::update_desc, ellen_bintree_pool::update_desc_pool_accessor > - > - ,co::node_allocator< ellen_bintree_pool::internal_node_allocator< int > > - ,co::item_counter< cds::atomicity::item_counter > - >::type - {}; - typedef cc::EllenBinTreeMap< rcu_sht, Key, Value, traits_EllenBinTreeMap_rcu_sht > EllenBinTreeMap_rcu_sht; + struct traits_EllenBinTreeMap_stat_gpt : public traits_EllenBinTreeMap_stat + { + typedef cds::memory::pool_allocator< typename ellen_bintree_props::gpt::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator; + }; + typedef cc::EllenBinTreeMap< rcu_gpt, Key, Value, traits_EllenBinTreeMap_stat_gpt > EllenBinTreeMap_rcu_gpt_stat; - struct traits_EllenBinTreeMap_rcu_sht_stat: public cc::ellen_bintree::make_set_traits< - co::less< less > - ,cc::ellen_bintree::update_desc_allocator< - cds::memory::pool_allocator< typename ellen_bintree_props::sht::update_desc, ellen_bintree_pool::update_desc_pool_accessor > - > - ,co::node_allocator< ellen_bintree_pool::internal_node_allocator< int > > - ,co::item_counter< cds::atomicity::item_counter > - ,co::stat< cc::ellen_bintree::stat<> > - >::type - {}; - typedef cc::EllenBinTreeMap< rcu_sht, Key, Value, traits_EllenBinTreeMap_rcu_sht_stat > EllenBinTreeMap_rcu_sht_stat; +#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED + struct traits_EllenBinTreeMap_stat_shb : public traits_EllenBinTreeMap_stat + { + typedef cds::memory::pool_allocator< typename ellen_bintree_props::shb::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator; + }; + typedef cc::EllenBinTreeMap< rcu_shb, Key, Value, traits_EllenBinTreeMap_stat_shb > EllenBinTreeMap_rcu_shb_stat; + struct traits_EllenBinTreeMap_stat_sht : public traits_EllenBinTreeMap_stat + { + typedef cds::memory::pool_allocator< typename ellen_bintree_props::sht::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator; + }; + typedef cc::EllenBinTreeMap< rcu_sht, Key, Value, traits_EllenBinTreeMap_stat_sht > EllenBinTreeMap_rcu_sht_stat; #endif - // *************************************************************************** // Standard implementations diff --git a/tests/unit/pqueue/ellen_bintree_pqueue.h b/tests/unit/pqueue/ellen_bintree_pqueue.h index 9651d066..8be18c7e 100644 --- a/tests/unit/pqueue/ellen_bintree_pqueue.h +++ b/tests/unit/pqueue/ellen_bintree_pqueue.h @@ -4,7 +4,7 @@ #define __CDSUNIT_STD_ELLEN_BINTREE_PQUEUE_H #include -#include +#include #include #include #include diff --git a/tests/unit/pqueue/pqueue_defs.h b/tests/unit/pqueue/pqueue_defs.h index 845ad4ed..4dcf3734 100644 --- a/tests/unit/pqueue/pqueue_defs.h +++ b/tests/unit/pqueue/pqueue_defs.h @@ -55,7 +55,9 @@ TEST_CASE(EllenBinTree_HP_min) \ TEST_CASE(EllenBinTree_HP_min_stat) \ TEST_CASE(EllenBinTree_DHP_max) \ + TEST_CASE(EllenBinTree_DHP_max_stat) \ TEST_CASE(EllenBinTree_DHP_min) \ + TEST_CASE(EllenBinTree_DHP_min_stat) \ TEST_CASE(EllenBinTree_RCU_gpi_max) \ TEST_CASE(EllenBinTree_RCU_gpi_max_stat) \ TEST_CASE(EllenBinTree_RCU_gpi_min) \ @@ -75,7 +77,9 @@ CPPUNIT_TEST(EllenBinTree_HP_min) \ CPPUNIT_TEST(EllenBinTree_HP_min_stat) \ CPPUNIT_TEST(EllenBinTree_DHP_max) \ + CPPUNIT_TEST(EllenBinTree_DHP_max_stat) \ CPPUNIT_TEST(EllenBinTree_DHP_min) \ + CPPUNIT_TEST(EllenBinTree_DHP_min_stat) \ /*CPPUNIT_TEST(EllenBinTree_RCU_gpi_max)*/ \ /*CPPUNIT_TEST(EllenBinTree_RCU_gpi_max_stat)*/ \ /*CPPUNIT_TEST(EllenBinTree_RCU_gpi_min)*/ \ @@ -114,7 +118,9 @@ TEST_CASE(SkipList_HP_min) \ TEST_CASE(SkipList_HP_min_stat) \ TEST_CASE(SkipList_DHP_max) \ + TEST_CASE(SkipList_DHP_max_stat) \ TEST_CASE(SkipList_DHP_min) \ + TEST_CASE(SkipList_DHP_min_stat) \ TEST_CASE(SkipList_RCU_gpi_max) \ TEST_CASE(SkipList_RCU_gpi_min) \ TEST_CASE(SkipList_RCU_gpb_max) \ @@ -128,7 +134,9 @@ CPPUNIT_TEST(SkipList_HP_min) \ CPPUNIT_TEST(SkipList_HP_min_stat) \ CPPUNIT_TEST(SkipList_DHP_max) \ + CPPUNIT_TEST(SkipList_DHP_max_stat) \ CPPUNIT_TEST(SkipList_DHP_min) \ + CPPUNIT_TEST(SkipList_DHP_min_stat) \ CPPUNIT_TEST(SkipList_RCU_gpi_max) \ CPPUNIT_TEST(SkipList_RCU_gpi_min) \ CPPUNIT_TEST(SkipList_RCU_gpb_max) \ diff --git a/tests/unit/pqueue/pqueue_type.h b/tests/unit/pqueue/pqueue_type.h index 803aad84..5c271d6a 100644 --- a/tests/unit/pqueue/pqueue_type.h +++ b/tests/unit/pqueue/pqueue_type.h @@ -38,6 +38,14 @@ namespace pqueue { } }; + typedef cds::urcu::gc< cds::urcu::general_instant<> > rcu_gpi; + typedef cds::urcu::gc< cds::urcu::general_buffered<> > rcu_gpb; + typedef cds::urcu::gc< cds::urcu::general_threaded<> > rcu_gpt; +#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED + typedef cds::urcu::gc< cds::urcu::signal_buffered<> > rcu_shb; + typedef cds::urcu::gc< cds::urcu::signal_threaded<> > rcu_sht; +#endif + // MSPriorityQueue struct traits_MSPriorityQueue_static_less : public @@ -103,304 +111,137 @@ namespace pqueue { // Priority queue based on EllenBinTreeSet - typedef EllenBinTreePQueue< cds::gc::HP, typename Value::key_type, Value, - typename cc::ellen_bintree::make_set_traits< - cc::ellen_bintree::key_extractor< typename Value::key_extractor > - ,cc::opt::less< std::less > - >::type - > EllenBinTree_HP_max; - - typedef EllenBinTreePQueue< cds::gc::HP, typename Value::key_type, Value, - typename cc::ellen_bintree::make_set_traits< - cc::ellen_bintree::key_extractor< typename Value::key_extractor > - ,cc::opt::less< std::less > - ,co::stat< cc::ellen_bintree::stat<> > - >::type - > EllenBinTree_HP_max_stat; - - typedef EllenBinTreePQueue< cds::gc::HP, typename Value::key_type, Value, - typename cc::ellen_bintree::make_set_traits< - cc::ellen_bintree::key_extractor< typename Value::key_extractor > - ,cc::opt::less< std::greater > - >::type, false - > EllenBinTree_HP_min; - - typedef EllenBinTreePQueue< cds::gc::HP, typename Value::key_type, Value, - typename cc::ellen_bintree::make_set_traits< - cc::ellen_bintree::key_extractor< typename Value::key_extractor > - ,cc::opt::less< std::greater > - ,co::stat< cc::ellen_bintree::stat<> > - >::type, false - > EllenBinTree_HP_min_stat; - - typedef EllenBinTreePQueue< cds::gc::DHP, typename Value::key_type, Value, - typename cc::ellen_bintree::make_set_traits< - cc::ellen_bintree::key_extractor< typename Value::key_extractor > - ,cc::opt::less< std::less > - >::type - > EllenBinTree_DHP_max; - - typedef EllenBinTreePQueue< cds::gc::DHP, typename Value::key_type, Value, - typename cc::ellen_bintree::make_set_traits< - cc::ellen_bintree::key_extractor< typename Value::key_extractor > - ,cc::opt::less< std::greater > - >::type, false - > EllenBinTree_DHP_min; - - typedef EllenBinTreePQueue< cds::urcu::gc< cds::urcu::general_instant<> >, typename Value::key_type, Value, - typename cc::ellen_bintree::make_set_traits< - cc::ellen_bintree::key_extractor< typename Value::key_extractor > - ,cc::opt::less< std::less > - >::type - > EllenBinTree_RCU_gpi_max; - - typedef EllenBinTreePQueue< cds::urcu::gc< cds::urcu::general_instant<> >, typename Value::key_type, Value, - typename cc::ellen_bintree::make_set_traits< + struct traits_EllenBinTree_max : + public cc::ellen_bintree::make_set_traits< cc::ellen_bintree::key_extractor< typename Value::key_extractor > ,cc::opt::less< std::less > ,co::stat< cc::ellen_bintree::stat<> > >::type - > EllenBinTree_RCU_gpi_max_stat; - - typedef EllenBinTreePQueue< cds::urcu::gc< cds::urcu::general_instant<> >, typename Value::key_type, Value, - typename cc::ellen_bintree::make_set_traits< - cc::ellen_bintree::key_extractor< typename Value::key_extractor > - ,cc::opt::less< std::greater > - >::type, false - > EllenBinTree_RCU_gpi_min; - - typedef EllenBinTreePQueue< cds::urcu::gc< cds::urcu::general_instant<> >, typename Value::key_type, Value, - typename cc::ellen_bintree::make_set_traits< - cc::ellen_bintree::key_extractor< typename Value::key_extractor > - ,cc::opt::less< std::greater > - ,co::stat< cc::ellen_bintree::stat<> > - >::type, false - > EllenBinTree_RCU_gpi_min_stat; - - typedef EllenBinTreePQueue< cds::urcu::gc< cds::urcu::general_buffered<> >, typename Value::key_type, Value, - typename cc::ellen_bintree::make_set_traits< - cc::ellen_bintree::key_extractor< typename Value::key_extractor > - ,cc::opt::less< std::less > - >::type - > EllenBinTree_RCU_gpb_max; + {}; + typedef EllenBinTreePQueue< cds::gc::HP, typename Value::key_type, Value, traits_EllenBinTree_max > EllenBinTree_HP_max; + typedef EllenBinTreePQueue< cds::gc::DHP, typename Value::key_type, Value, traits_EllenBinTree_max > EllenBinTree_DHP_max; + typedef EllenBinTreePQueue< rcu_gpi, typename Value::key_type, Value, traits_EllenBinTree_max > EllenBinTree_RCU_gpi_max; + typedef EllenBinTreePQueue< rcu_gpb, typename Value::key_type, Value, traits_EllenBinTree_max > EllenBinTree_RCU_gpb_max; + typedef EllenBinTreePQueue< rcu_gpt, typename Value::key_type, Value, traits_EllenBinTree_max > EllenBinTree_RCU_gpt_max; +#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED + typedef EllenBinTreePQueue< rcu_shb, typename Value::key_type, Value, traits_EllenBinTree_max > EllenBinTree_RCU_shb_max; + typedef EllenBinTreePQueue< rcu_sht, typename Value::key_type, Value, traits_EllenBinTree_max > EllenBinTree_RCU_sht_max; +#endif - typedef EllenBinTreePQueue< cds::urcu::gc< cds::urcu::general_buffered<> >, typename Value::key_type, Value, - typename cc::ellen_bintree::make_set_traits< + struct traits_EllenBinTree_max_stat : + public cc::ellen_bintree::make_set_traits< cc::ellen_bintree::key_extractor< typename Value::key_extractor > ,cc::opt::less< std::less > ,co::stat< cc::ellen_bintree::stat<> > >::type - > EllenBinTree_RCU_gpb_max_stat; - - typedef EllenBinTreePQueue< cds::urcu::gc< cds::urcu::general_buffered<> >, typename Value::key_type, Value, - typename cc::ellen_bintree::make_set_traits< - cc::ellen_bintree::key_extractor< typename Value::key_extractor > - ,cc::opt::less< std::greater > - >::type, false - > EllenBinTree_RCU_gpb_min; + {}; + typedef EllenBinTreePQueue< cds::gc::HP, typename Value::key_type, Value, traits_EllenBinTree_max_stat > EllenBinTree_HP_max_stat; + typedef EllenBinTreePQueue< cds::gc::DHP, typename Value::key_type, Value, traits_EllenBinTree_max_stat > EllenBinTree_DHP_max_stat; + typedef EllenBinTreePQueue< rcu_gpi, typename Value::key_type, Value, traits_EllenBinTree_max_stat > EllenBinTree_RCU_gpi_max_stat; + typedef EllenBinTreePQueue< rcu_gpb, typename Value::key_type, Value, traits_EllenBinTree_max_stat > EllenBinTree_RCU_gpb_max_stat; + typedef EllenBinTreePQueue< rcu_gpt, typename Value::key_type, Value, traits_EllenBinTree_max_stat > EllenBinTree_RCU_gpt_max_stat; +#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED + typedef EllenBinTreePQueue< rcu_shb, typename Value::key_type, Value, traits_EllenBinTree_max_stat > EllenBinTree_RCU_shb_max_stat; + typedef EllenBinTreePQueue< rcu_sht, typename Value::key_type, Value, traits_EllenBinTree_max_stat > EllenBinTree_RCU_sht_max_stat; +#endif - typedef EllenBinTreePQueue< cds::urcu::gc< cds::urcu::general_buffered<> >, typename Value::key_type, Value, - typename cc::ellen_bintree::make_set_traits< + struct traits_EllenBinTree_min : + public cc::ellen_bintree::make_set_traits< cc::ellen_bintree::key_extractor< typename Value::key_extractor > ,cc::opt::less< std::greater > - ,co::stat< cc::ellen_bintree::stat<> > - >::type, false - > EllenBinTree_RCU_gpb_min_stat; - - typedef EllenBinTreePQueue< cds::urcu::gc< cds::urcu::general_threaded<> >, typename Value::key_type, Value, - typename cc::ellen_bintree::make_set_traits< - cc::ellen_bintree::key_extractor< typename Value::key_extractor > - ,cc::opt::less< std::less > >::type - > EllenBinTree_RCU_gpt_max; - - typedef EllenBinTreePQueue< cds::urcu::gc< cds::urcu::general_threaded<> >, typename Value::key_type, Value, - typename cc::ellen_bintree::make_set_traits< - cc::ellen_bintree::key_extractor< typename Value::key_extractor > - ,cc::opt::less< std::less > - ,co::stat< cc::ellen_bintree::stat<> > - >::type - > EllenBinTree_RCU_gpt_max_stat; - - typedef EllenBinTreePQueue< cds::urcu::gc< cds::urcu::general_threaded<> >, typename Value::key_type, Value, - typename cc::ellen_bintree::make_set_traits< - cc::ellen_bintree::key_extractor< typename Value::key_extractor > - ,cc::opt::less< std::greater > - >::type, false - > EllenBinTree_RCU_gpt_min; - - typedef EllenBinTreePQueue< cds::urcu::gc< cds::urcu::general_threaded<> >, typename Value::key_type, Value, - typename cc::ellen_bintree::make_set_traits< - cc::ellen_bintree::key_extractor< typename Value::key_extractor > - ,cc::opt::less< std::greater > - ,co::stat< cc::ellen_bintree::stat<> > - >::type, false - > EllenBinTree_RCU_gpt_min_stat; - + {}; + typedef EllenBinTreePQueue< cds::gc::HP, typename Value::key_type, Value, traits_EllenBinTree_min, false > EllenBinTree_HP_min; + typedef EllenBinTreePQueue< cds::gc::DHP, typename Value::key_type, Value, traits_EllenBinTree_min, false > EllenBinTree_DHP_min; + typedef EllenBinTreePQueue< rcu_gpi, typename Value::key_type, Value, traits_EllenBinTree_min, false > EllenBinTree_RCU_gpi_min; + typedef EllenBinTreePQueue< rcu_gpb, typename Value::key_type, Value, traits_EllenBinTree_min, false > EllenBinTree_RCU_gpb_min; + typedef EllenBinTreePQueue< rcu_gpt, typename Value::key_type, Value, traits_EllenBinTree_min, false > EllenBinTree_RCU_gpt_min; #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef EllenBinTreePQueue< cds::urcu::gc< cds::urcu::signal_buffered<> >, typename Value::key_type, Value, - typename cc::ellen_bintree::make_set_traits< - cc::ellen_bintree::key_extractor< typename Value::key_extractor > - ,cc::opt::less< std::less > - >::type - > EllenBinTree_RCU_shb_max; - - typedef EllenBinTreePQueue< cds::urcu::gc< cds::urcu::signal_buffered<> >, typename Value::key_type, Value, - typename cc::ellen_bintree::make_set_traits< - cc::ellen_bintree::key_extractor< typename Value::key_extractor > - ,cc::opt::less< std::less > - ,co::stat< cc::ellen_bintree::stat<> > - >::type - > EllenBinTree_RCU_shb_max_stat; - - typedef EllenBinTreePQueue< cds::urcu::gc< cds::urcu::signal_buffered<> >, typename Value::key_type, Value, - typename cc::ellen_bintree::make_set_traits< - cc::ellen_bintree::key_extractor< typename Value::key_extractor > - ,cc::opt::less< std::greater > - >::type, false - > EllenBinTree_RCU_shb_min; + typedef EllenBinTreePQueue< rcu_shb, typename Value::key_type, Value, traits_EllenBinTree_min, false > EllenBinTree_RCU_shb_min; + typedef EllenBinTreePQueue< rcu_sht, typename Value::key_type, Value, traits_EllenBinTree_min, false > EllenBinTree_RCU_sht_min; +#endif - typedef EllenBinTreePQueue< cds::urcu::gc< cds::urcu::signal_buffered<> >, typename Value::key_type, Value, - typename cc::ellen_bintree::make_set_traits< + struct traits_EllenBinTree_min_stat : + public cc::ellen_bintree::make_set_traits< cc::ellen_bintree::key_extractor< typename Value::key_extractor > ,cc::opt::less< std::greater > ,co::stat< cc::ellen_bintree::stat<> > - >::type, false - > EllenBinTree_RCU_shb_min_stat; - - typedef EllenBinTreePQueue< cds::urcu::gc< cds::urcu::signal_threaded<> >, typename Value::key_type, Value, - typename cc::ellen_bintree::make_set_traits< - cc::ellen_bintree::key_extractor< typename Value::key_extractor > - ,cc::opt::less< std::less > >::type - > EllenBinTree_RCU_sht_max; - - typedef EllenBinTreePQueue< cds::urcu::gc< cds::urcu::signal_threaded<> >, typename Value::key_type, Value, - typename cc::ellen_bintree::make_set_traits< - cc::ellen_bintree::key_extractor< typename Value::key_extractor > - ,cc::opt::less< std::less > - ,co::stat< cc::ellen_bintree::stat<> > - >::type - > EllenBinTree_RCU_sht_max_stat; - - typedef EllenBinTreePQueue< cds::urcu::gc< cds::urcu::signal_threaded<> >, typename Value::key_type, Value, - typename cc::ellen_bintree::make_set_traits< - cc::ellen_bintree::key_extractor< typename Value::key_extractor > - ,cc::opt::less< std::greater > - >::type, false - > EllenBinTree_RCU_sht_min; - - typedef EllenBinTreePQueue< cds::urcu::gc< cds::urcu::signal_threaded<> >, typename Value::key_type, Value, - typename cc::ellen_bintree::make_set_traits< - cc::ellen_bintree::key_extractor< typename Value::key_extractor > - ,cc::opt::less< std::greater > - ,co::stat< cc::ellen_bintree::stat<> > - >::type, false - > EllenBinTree_RCU_sht_min_stat; + {}; + typedef EllenBinTreePQueue< cds::gc::HP, typename Value::key_type, Value, traits_EllenBinTree_min_stat, false > EllenBinTree_HP_min_stat; + typedef EllenBinTreePQueue< cds::gc::DHP, typename Value::key_type, Value, traits_EllenBinTree_min_stat, false > EllenBinTree_DHP_min_stat; + typedef EllenBinTreePQueue< rcu_gpi, typename Value::key_type, Value, traits_EllenBinTree_min_stat, false > EllenBinTree_RCU_gpi_min_stat; + typedef EllenBinTreePQueue< rcu_gpb, typename Value::key_type, Value, traits_EllenBinTree_min_stat, false > EllenBinTree_RCU_gpb_min_stat; + typedef EllenBinTreePQueue< rcu_gpt, typename Value::key_type, Value, traits_EllenBinTree_min_stat, false > EllenBinTree_RCU_gpt_min_stat; +#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED + typedef EllenBinTreePQueue< rcu_shb, typename Value::key_type, Value, traits_EllenBinTree_min_stat, false > EllenBinTree_RCU_shb_min_stat; + typedef EllenBinTreePQueue< rcu_sht, typename Value::key_type, Value, traits_EllenBinTree_min_stat, false > EllenBinTree_RCU_sht_min_stat; #endif // Priority queue based on SkipListSet - typedef SkipListPQueue< cds::gc::HP, Value, - typename cc::skip_list::make_traits< - cc::opt::less< std::less > - >::type - > SkipList_HP_max; + struct traits_SkipList_max : + public cc::skip_list::make_traits < + cc::opt::less < std::less > + > ::type + {}; + typedef SkipListPQueue< cds::gc::HP, Value, traits_SkipList_max > SkipList_HP_max; + typedef SkipListPQueue< cds::gc::DHP, Value, traits_SkipList_max > SkipList_DHP_max; + typedef SkipListPQueue< rcu_gpi, Value, traits_SkipList_max > SkipList_RCU_gpi_max; + typedef SkipListPQueue< rcu_gpb, Value, traits_SkipList_max > SkipList_RCU_gpb_max; + typedef SkipListPQueue< rcu_gpt, Value, traits_SkipList_max > SkipList_RCU_gpt_max; +#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED + typedef SkipListPQueue< rcu_shb, Value, traits_SkipList_max > SkipList_RCU_shb_max; + typedef SkipListPQueue< rcu_sht, Value, traits_SkipList_max > SkipList_RCU_sht_max; +#endif - typedef SkipListPQueue< cds::gc::HP, Value, - typename cc::skip_list::make_traits< + struct traits_SkipList_max_stat : + public cc::skip_list::make_traits< cc::opt::less< std::less > ,co::stat< cc::skip_list::stat<> > >::type - > SkipList_HP_max_stat; - - typedef SkipListPQueue< cds::gc::HP, Value, - typename cc::skip_list::make_traits< - cc::opt::less< std::greater > - >::type, false - > SkipList_HP_min; - - typedef SkipListPQueue< cds::gc::HP, Value, - typename cc::skip_list::make_traits< - cc::opt::less< std::greater > - ,co::stat< cc::skip_list::stat<> > - >::type, false - > SkipList_HP_min_stat; - - - typedef SkipListPQueue< cds::gc::DHP, Value, - typename cc::skip_list::make_traits< - cc::opt::less< std::less > - >::type - > SkipList_DHP_max; - - typedef SkipListPQueue< cds::gc::DHP, Value, - typename cc::skip_list::make_traits< - cc::opt::less< std::greater > - >::type, false - > SkipList_DHP_min; - - typedef SkipListPQueue< cds::urcu::gc< cds::urcu::general_instant<> >, Value, - typename cc::skip_list::make_traits< - cc::opt::less< std::less > - >::type - > SkipList_RCU_gpi_max; + {}; + typedef SkipListPQueue< cds::gc::HP, Value, traits_SkipList_max_stat > SkipList_HP_max_stat; + typedef SkipListPQueue< cds::gc::DHP, Value, traits_SkipList_max_stat > SkipList_DHP_max_stat; + typedef SkipListPQueue< rcu_gpi, Value, traits_SkipList_max_stat > SkipList_RCU_gpi_max_stat; + typedef SkipListPQueue< rcu_gpb, Value, traits_SkipList_max_stat > SkipList_RCU_gpb_max_stat; + typedef SkipListPQueue< rcu_gpt, Value, traits_SkipList_max_stat > SkipList_RCU_gpt_max_stat; +#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED + typedef SkipListPQueue< rcu_shb, Value, traits_SkipList_max_stat > SkipList_RCU_shb_max_stat; + typedef SkipListPQueue< rcu_sht, Value, traits_SkipList_max_stat > SkipList_RCU_sht_max_stat; +#endif - typedef SkipListPQueue< cds::urcu::gc< cds::urcu::general_instant<> >, Value, - typename cc::skip_list::make_traits< + struct traits_SkipList_min : + public cc::skip_list::make_traits< cc::opt::less< std::greater > - >::type, false - > SkipList_RCU_gpi_min; - - typedef SkipListPQueue< cds::urcu::gc< cds::urcu::general_buffered<> >, Value, - typename cc::skip_list::make_traits< - cc::opt::less< std::less > >::type - > SkipList_RCU_gpb_max; - - typedef SkipListPQueue< cds::urcu::gc< cds::urcu::general_buffered<> >, Value, - typename cc::skip_list::make_traits< - cc::opt::less< std::greater > - >::type, false - > SkipList_RCU_gpb_min; - - typedef SkipListPQueue< cds::urcu::gc< cds::urcu::general_threaded<> >, Value, - typename cc::skip_list::make_traits< - cc::opt::less< std::less > - >::type - > SkipList_RCU_gpt_max; - - typedef SkipListPQueue< cds::urcu::gc< cds::urcu::general_threaded<> >, Value, - typename cc::skip_list::make_traits< - cc::opt::less< std::greater > - >::type, false - > SkipList_RCU_gpt_min; - + {}; + typedef SkipListPQueue< cds::gc::HP, Value, traits_SkipList_min, false > SkipList_HP_min; + typedef SkipListPQueue< cds::gc::DHP, Value, traits_SkipList_min, false > SkipList_DHP_min; + typedef SkipListPQueue< rcu_gpi, Value, traits_SkipList_min, false > SkipList_RCU_gpi_min; + typedef SkipListPQueue< rcu_gpb, Value, traits_SkipList_min, false > SkipList_RCU_gpb_min; + typedef SkipListPQueue< rcu_gpt, Value, traits_SkipList_min, false > SkipList_RCU_gpt_min; #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef SkipListPQueue< cds::urcu::gc< cds::urcu::signal_buffered<> >, Value, - typename cc::skip_list::make_traits< - cc::opt::less< std::less > - >::type - > SkipList_RCU_shb_max; + typedef SkipListPQueue< rcu_shb, Value, traits_SkipList_min, false > SkipList_RCU_shb_min; + typedef SkipListPQueue< rcu_sht, Value, traits_SkipList_min, false > SkipList_RCU_sht_min; +#endif - typedef SkipListPQueue< cds::urcu::gc< cds::urcu::signal_buffered<> >, Value, - typename cc::skip_list::make_traits< + struct traits_SkipList_min_stat : + public cc::skip_list::make_traits< cc::opt::less< std::greater > - >::type, false - > SkipList_RCU_shb_min; - - typedef SkipListPQueue< cds::urcu::gc< cds::urcu::signal_threaded<> >, Value, - typename cc::skip_list::make_traits< - cc::opt::less< std::less > + ,co::stat< cc::skip_list::stat<> > >::type - > SkipList_RCU_sht_max; - - typedef SkipListPQueue< cds::urcu::gc< cds::urcu::signal_threaded<> >, Value, - typename cc::skip_list::make_traits< - cc::opt::less< std::greater > - >::type, false - > SkipList_RCU_sht_min; + {}; + typedef SkipListPQueue< cds::gc::HP, Value, traits_SkipList_min_stat, false > SkipList_HP_min_stat; + typedef SkipListPQueue< cds::gc::DHP, Value, traits_SkipList_min_stat, false > SkipList_DHP_min_stat; + typedef SkipListPQueue< rcu_gpi, Value, traits_SkipList_min_stat, false > SkipList_RCU_gpi_min_stat; + typedef SkipListPQueue< rcu_gpb, Value, traits_SkipList_min_stat, false > SkipList_RCU_gpb_min_stat; + typedef SkipListPQueue< rcu_gpt, Value, traits_SkipList_min_stat, false > SkipList_RCU_gpt_min_stat; +#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED + typedef SkipListPQueue< rcu_shb, Value, traits_SkipList_min_stat, false > SkipList_RCU_shb_min_stat; + typedef SkipListPQueue< rcu_sht, Value, traits_SkipList_min_stat, false > SkipList_RCU_sht_min_stat; #endif + // FCPriorityQueue struct traits_FCPQueue_stat : public cds::container::fcpqueue::make_traits < diff --git a/tests/unit/set2/set_defs.h b/tests/unit/set2/set_defs.h index c96ca544..f0bb9d28 100644 --- a/tests/unit/set2/set_defs.h +++ b/tests/unit/set2/set_defs.h @@ -416,8 +416,8 @@ #define CDSUNIT_DECLARE_EllenBinTreeSet \ TEST_SET_NOLF_EXTRACT(EllenBinTreeSet_hp)\ TEST_SET_NOLF_EXTRACT(EllenBinTreeSet_hp_stat)\ - TEST_SET_NOLF_EXTRACT(EllenBinTreeSet_ptb)\ - TEST_SET_NOLF_EXTRACT(EllenBinTreeSet_ptb_stat)\ + TEST_SET_NOLF_EXTRACT(EllenBinTreeSet_dhp)\ + TEST_SET_NOLF_EXTRACT(EllenBinTreeSet_dhp_stat)\ TEST_SET_NOLF_EXTRACT(EllenBinTreeSet_rcu_gpi)\ TEST_SET_NOLF_EXTRACT(EllenBinTreeSet_rcu_gpi_stat)\ TEST_SET_NOLF_EXTRACT(EllenBinTreeSet_rcu_gpb)\ @@ -429,8 +429,8 @@ #define CDSUNIT_TEST_EllenBinTreeSet \ CPPUNIT_TEST(EllenBinTreeSet_hp)\ CPPUNIT_TEST(EllenBinTreeSet_hp_stat)\ - CPPUNIT_TEST(EllenBinTreeSet_ptb)\ - CPPUNIT_TEST(EllenBinTreeSet_ptb_stat)\ + CPPUNIT_TEST(EllenBinTreeSet_dhp)\ + CPPUNIT_TEST(EllenBinTreeSet_dhp_stat)\ CPPUNIT_TEST(EllenBinTreeSet_rcu_gpi)\ /*CPPUNIT_TEST(EllenBinTreeSet_rcu_gpi_stat)*/\ CPPUNIT_TEST(EllenBinTreeSet_rcu_gpb)\ diff --git a/tests/unit/set2/set_types.h b/tests/unit/set2/set_types.h index a41de00b..8c3d09c6 100644 --- a/tests/unit/set2/set_types.h +++ b/tests/unit/set2/set_types.h @@ -30,7 +30,7 @@ #include #include -#include +#include #include #include @@ -1634,7 +1634,7 @@ namespace set2 { typedef cc::ellen_bintree::update_desc< leaf_node, internal_node > update_desc; }; - struct ptb_gc { + struct dhp_gc { typedef cc::ellen_bintree::node leaf_node; typedef cc::ellen_bintree::internal_node< key_type, leaf_node > internal_node; typedef cc::ellen_bintree::update_desc< leaf_node, internal_node > update_desc; @@ -1669,179 +1669,107 @@ namespace set2 { #endif }; - - // *************************************************************************** - // EllenBinTreeSet - HP - - class traits_EllenBinTreeSet_hp: public cc::ellen_bintree::make_set_traits< - cc::ellen_bintree::key_extractor< typename ellen_bintree_props::key_extractor > - ,co::less< typename ellen_bintree_props::less > - ,cc::ellen_bintree::update_desc_allocator< - cds::memory::pool_allocator< typename ellen_bintree_props::hp_gc::update_desc, ellen_bintree_pool::update_desc_pool_accessor > - > - ,co::node_allocator< ellen_bintree_pool::internal_node_allocator< int > > - >::type - {}; - typedef cc::EllenBinTreeSet< cds::gc::HP, key_type, key_val, traits_EllenBinTreeSet_hp > EllenBinTreeSet_hp; - - class traits_EllenBinTreeSet_hp_stat: public cc::ellen_bintree::make_set_traits< + struct traits_EllenBinTreeSet: public cc::ellen_bintree::make_set_traits< cc::ellen_bintree::key_extractor< typename ellen_bintree_props::key_extractor > ,co::less< typename ellen_bintree_props::less > - ,cc::ellen_bintree::update_desc_allocator< - cds::memory::pool_allocator< typename ellen_bintree_props::hp_gc::update_desc, ellen_bintree_pool::update_desc_pool_accessor > - > ,co::node_allocator< ellen_bintree_pool::internal_node_allocator< int > > - ,co::stat< cc::ellen_bintree::stat<> > >::type {}; - typedef cc::EllenBinTreeSet< cds::gc::HP, key_type, key_val, traits_EllenBinTreeSet_hp_stat > EllenBinTreeSet_hp_stat; - - // *************************************************************************** - // EllenBinTreeSet - DHP - class traits_EllenBinTreeSet_ptb: public cc::ellen_bintree::make_set_traits< - cc::ellen_bintree::key_extractor< typename ellen_bintree_props::key_extractor > - ,co::less< typename ellen_bintree_props::less > - ,cc::ellen_bintree::update_desc_allocator< - cds::memory::pool_allocator< typename ellen_bintree_props::ptb_gc::update_desc, ellen_bintree_pool::update_desc_pool_accessor > - > - ,co::node_allocator< ellen_bintree_pool::internal_node_allocator< int > > - >::type - {}; - typedef cc::EllenBinTreeSet< cds::gc::DHP, key_type, key_val, traits_EllenBinTreeSet_ptb > EllenBinTreeSet_ptb; + struct traits_EllenBinTreeSet_hp : public traits_EllenBinTreeSet + { + typedef cds::memory::pool_allocator< typename ellen_bintree_props::hp_gc::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator; + }; + typedef cc::EllenBinTreeSet< cds::gc::HP, key_type, key_val, traits_EllenBinTreeSet_hp > EllenBinTreeSet_hp; - class traits_EllenBinTreeSet_ptb_stat: public cc::ellen_bintree::make_set_traits< - cc::ellen_bintree::key_extractor< typename ellen_bintree_props::key_extractor > - ,co::less< typename ellen_bintree_props::less > - ,cc::ellen_bintree::update_desc_allocator< - cds::memory::pool_allocator< typename ellen_bintree_props::ptb_gc::update_desc, ellen_bintree_pool::update_desc_pool_accessor > - > - ,co::node_allocator< ellen_bintree_pool::internal_node_allocator< int > > - ,co::stat< cc::ellen_bintree::stat<> > - >::type - {}; - typedef cc::EllenBinTreeSet< cds::gc::DHP, key_type, key_val, traits_EllenBinTreeSet_ptb_stat > EllenBinTreeSet_ptb_stat; + struct traits_EllenBinTreeSet_dhp : public traits_EllenBinTreeSet + { + typedef cds::memory::pool_allocator< typename ellen_bintree_props::dhp_gc::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator; + }; + typedef cc::EllenBinTreeSet< cds::gc::DHP, key_type, key_val, traits_EllenBinTreeSet_dhp > EllenBinTreeSet_dhp; + struct traits_EllenBinTreeSet_gpi : public traits_EllenBinTreeSet + { + typedef cds::memory::pool_allocator< typename ellen_bintree_props::gpi::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator; + }; + typedef cc::EllenBinTreeSet< rcu_gpi, key_type, key_val, traits_EllenBinTreeSet_gpi > EllenBinTreeSet_rcu_gpi; - // *************************************************************************** - // EllenBinTreeSet - RCU + struct traits_EllenBinTreeSet_gpb : public traits_EllenBinTreeSet + { + typedef cds::memory::pool_allocator< typename ellen_bintree_props::gpb::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator; + }; + typedef cc::EllenBinTreeSet< rcu_gpb, key_type, key_val, traits_EllenBinTreeSet_gpb > EllenBinTreeSet_rcu_gpb; - class traits_EllenBinTreeSet_rcu_gpi: public cc::ellen_bintree::make_set_traits< - cc::ellen_bintree::key_extractor< typename ellen_bintree_props::key_extractor > - ,co::less< typename ellen_bintree_props::less > - ,cc::ellen_bintree::update_desc_allocator< - cds::memory::pool_allocator< typename ellen_bintree_props::gpi::update_desc, ellen_bintree_pool::bounded_update_desc_pool_accessor > - > - ,co::node_allocator< ellen_bintree_pool::internal_node_allocator< int > > - >::type - {}; - typedef cc::EllenBinTreeSet< rcu_gpi, key_type, key_val, traits_EllenBinTreeSet_rcu_gpi > EllenBinTreeSet_rcu_gpi; + struct traits_EllenBinTreeSet_gpt : public traits_EllenBinTreeSet + { + typedef cds::memory::pool_allocator< typename ellen_bintree_props::gpt::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator; + }; + typedef cc::EllenBinTreeSet< rcu_gpt, key_type, key_val, traits_EllenBinTreeSet_gpt > EllenBinTreeSet_rcu_gpt; - class traits_EllenBinTreeSet_rcu_gpi_stat: public cc::ellen_bintree::make_set_traits< - cc::ellen_bintree::key_extractor< typename ellen_bintree_props::key_extractor > - ,co::less< typename ellen_bintree_props::less > - ,cc::ellen_bintree::update_desc_allocator< - cds::memory::pool_allocator< typename ellen_bintree_props::gpi::update_desc, ellen_bintree_pool::bounded_update_desc_pool_accessor > - > - ,co::node_allocator< ellen_bintree_pool::internal_node_allocator< int > > - ,co::stat< cc::ellen_bintree::stat<> > - >::type - {}; - typedef cc::EllenBinTreeSet< rcu_gpi, key_type, key_val, traits_EllenBinTreeSet_rcu_gpi_stat > EllenBinTreeSet_rcu_gpi_stat; +#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED + struct traits_EllenBinTreeSet_shb : public traits_EllenBinTreeSet + { + typedef cds::memory::pool_allocator< typename ellen_bintree_props::shb::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator; + }; + typedef cc::EllenBinTreeSet< rcu_shb, key_type, key_val, traits_EllenBinTreeSet_shb > EllenBinTreeSet_rcu_shb; - class traits_EllenBinTreeSet_rcu_gpb: public cc::ellen_bintree::make_set_traits< - cc::ellen_bintree::key_extractor< typename ellen_bintree_props::key_extractor > - ,co::less< typename ellen_bintree_props::less > - ,cc::ellen_bintree::update_desc_allocator< - cds::memory::pool_allocator< typename ellen_bintree_props::gpb::update_desc, ellen_bintree_pool::update_desc_pool_accessor > - > - ,co::node_allocator< ellen_bintree_pool::internal_node_allocator< int > > - >::type - {}; - typedef cc::EllenBinTreeSet< rcu_gpb, key_type, key_val, traits_EllenBinTreeSet_rcu_gpb > EllenBinTreeSet_rcu_gpb; + struct traits_EllenBinTreeSet_sht : public traits_EllenBinTreeSet + { + typedef cds::memory::pool_allocator< typename ellen_bintree_props::sht::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator; + }; + typedef cc::EllenBinTreeSet< rcu_sht, key_type, key_val, traits_EllenBinTreeSet_sht > EllenBinTreeSet_rcu_sht; +#endif - class traits_EllenBinTreeSet_rcu_gpb_stat: public cc::ellen_bintree::make_set_traits< + struct traits_EllenBinTreeSet_stat: public cc::ellen_bintree::make_set_traits< cc::ellen_bintree::key_extractor< typename ellen_bintree_props::key_extractor > ,co::less< typename ellen_bintree_props::less > - ,cc::ellen_bintree::update_desc_allocator< - cds::memory::pool_allocator< typename ellen_bintree_props::gpb::update_desc, ellen_bintree_pool::update_desc_pool_accessor > - > ,co::node_allocator< ellen_bintree_pool::internal_node_allocator< int > > ,co::stat< cc::ellen_bintree::stat<> > >::type {}; - typedef cc::EllenBinTreeSet< rcu_gpb, key_type, key_val, traits_EllenBinTreeSet_rcu_gpb_stat > EllenBinTreeSet_rcu_gpb_stat; - class traits_EllenBinTreeSet_rcu_gpt: public cc::ellen_bintree::make_set_traits< - cc::ellen_bintree::key_extractor< typename ellen_bintree_props::key_extractor > - ,co::less< typename ellen_bintree_props::less > - ,cc::ellen_bintree::update_desc_allocator< - cds::memory::pool_allocator< typename ellen_bintree_props::gpt::update_desc, ellen_bintree_pool::update_desc_pool_accessor > - > - ,co::node_allocator< ellen_bintree_pool::internal_node_allocator< int > > - >::type - {}; - typedef cc::EllenBinTreeSet< rcu_gpt, key_type, key_val, traits_EllenBinTreeSet_rcu_gpt > EllenBinTreeSet_rcu_gpt; + struct traits_EllenBinTreeSet_stat_hp : public traits_EllenBinTreeSet_stat + { + typedef cds::memory::pool_allocator< typename ellen_bintree_props::hp_gc::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator; + }; + typedef cc::EllenBinTreeSet< cds::gc::HP, key_type, key_val, traits_EllenBinTreeSet_stat_hp > EllenBinTreeSet_hp_stat; - class traits_EllenBinTreeSet_rcu_gpt_stat: public cc::ellen_bintree::make_set_traits< - cc::ellen_bintree::key_extractor< typename ellen_bintree_props::key_extractor > - ,co::less< typename ellen_bintree_props::less > - ,cc::ellen_bintree::update_desc_allocator< - cds::memory::pool_allocator< typename ellen_bintree_props::gpt::update_desc, ellen_bintree_pool::update_desc_pool_accessor > - > - ,co::node_allocator< ellen_bintree_pool::internal_node_allocator< int > > - ,co::stat< cc::ellen_bintree::stat<> > - >::type - {}; - typedef cc::EllenBinTreeSet< rcu_gpt, key_type, key_val, traits_EllenBinTreeSet_rcu_gpt_stat > EllenBinTreeSet_rcu_gpt_stat; + struct traits_EllenBinTreeSet_stat_dhp : public traits_EllenBinTreeSet_stat + { + typedef cds::memory::pool_allocator< typename ellen_bintree_props::dhp_gc::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator; + }; + typedef cc::EllenBinTreeSet< cds::gc::DHP, key_type, key_val, traits_EllenBinTreeSet_stat_dhp > EllenBinTreeSet_dhp_stat; -#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - class traits_EllenBinTreeSet_rcu_shb: public cc::ellen_bintree::make_set_traits< - cc::ellen_bintree::key_extractor< typename ellen_bintree_props::key_extractor > - ,co::less< typename ellen_bintree_props::less > - ,cc::ellen_bintree::update_desc_allocator< - cds::memory::pool_allocator< typename ellen_bintree_props::shb::update_desc, ellen_bintree_pool::update_desc_pool_accessor > - > - ,co::node_allocator< ellen_bintree_pool::internal_node_allocator< int > > - >::type - {}; - typedef cc::EllenBinTreeSet< rcu_shb, key_type, key_val, traits_EllenBinTreeSet_rcu_shb > EllenBinTreeSet_rcu_shb; + struct traits_EllenBinTreeSet_stat_gpi : public traits_EllenBinTreeSet_stat + { + typedef cds::memory::pool_allocator< typename ellen_bintree_props::gpi::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator; + }; + typedef cc::EllenBinTreeSet< rcu_gpi, key_type, key_val, traits_EllenBinTreeSet_stat_gpi > EllenBinTreeSet_rcu_gpi_stat; - class traits_EllenBinTreeSet_rcu_shb_stat: public cc::ellen_bintree::make_set_traits< - cc::ellen_bintree::key_extractor< typename ellen_bintree_props::key_extractor > - ,co::less< typename ellen_bintree_props::less > - ,cc::ellen_bintree::update_desc_allocator< - cds::memory::pool_allocator< typename ellen_bintree_props::shb::update_desc, ellen_bintree_pool::update_desc_pool_accessor > - > - ,co::node_allocator< ellen_bintree_pool::internal_node_allocator< int > > - ,co::stat< cc::ellen_bintree::stat<> > - >::type - {}; - typedef cc::EllenBinTreeSet< rcu_shb, key_type, key_val, traits_EllenBinTreeSet_rcu_shb_stat > EllenBinTreeSet_rcu_shb_stat; + struct traits_EllenBinTreeSet_stat_gpb : public traits_EllenBinTreeSet_stat + { + typedef cds::memory::pool_allocator< typename ellen_bintree_props::gpb::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator; + }; + typedef cc::EllenBinTreeSet< rcu_gpb, key_type, key_val, traits_EllenBinTreeSet_stat_gpb > EllenBinTreeSet_rcu_gpb_stat; - class traits_EllenBinTreeSet_rcu_sht: public cc::ellen_bintree::make_set_traits< - cc::ellen_bintree::key_extractor< typename ellen_bintree_props::key_extractor > - ,co::less< typename ellen_bintree_props::less > - ,cc::ellen_bintree::update_desc_allocator< - cds::memory::pool_allocator< typename ellen_bintree_props::sht::update_desc, ellen_bintree_pool::update_desc_pool_accessor > - > - ,co::node_allocator< ellen_bintree_pool::internal_node_allocator< int > > - >::type - {}; - typedef cc::EllenBinTreeSet< rcu_sht, key_type, key_val, traits_EllenBinTreeSet_rcu_sht > EllenBinTreeSet_rcu_sht; + struct traits_EllenBinTreeSet_stat_gpt : public traits_EllenBinTreeSet_stat + { + typedef cds::memory::pool_allocator< typename ellen_bintree_props::gpt::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator; + }; + typedef cc::EllenBinTreeSet< rcu_gpt, key_type, key_val, traits_EllenBinTreeSet_stat_gpt > EllenBinTreeSet_rcu_gpt_stat; - class traits_EllenBinTreeSet_rcu_sht_stat: public cc::ellen_bintree::make_set_traits< - cc::ellen_bintree::key_extractor< typename ellen_bintree_props::key_extractor > - ,co::less< typename ellen_bintree_props::less > - ,cc::ellen_bintree::update_desc_allocator< - cds::memory::pool_allocator< typename ellen_bintree_props::sht::update_desc, ellen_bintree_pool::update_desc_pool_accessor > - > - ,co::node_allocator< ellen_bintree_pool::internal_node_allocator< int > > - ,co::stat< cc::ellen_bintree::stat<> > - >::type - {}; - typedef cc::EllenBinTreeSet< rcu_sht, key_type, key_val, traits_EllenBinTreeSet_rcu_sht_stat > EllenBinTreeSet_rcu_sht_stat; +#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED + struct traits_EllenBinTreeSet_stat_shb : public traits_EllenBinTreeSet_stat + { + typedef cds::memory::pool_allocator< typename ellen_bintree_props::shb::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator; + }; + typedef cc::EllenBinTreeSet< rcu_shb, key_type, key_val, traits_EllenBinTreeSet_stat_shb > EllenBinTreeSet_rcu_shb_stat; + struct traits_EllenBinTreeSet_stat_sht : public traits_EllenBinTreeSet_stat + { + typedef cds::memory::pool_allocator< typename ellen_bintree_props::sht::update_desc, ellen_bintree_pool::update_desc_pool_accessor > update_desc_allocator; + }; + typedef cc::EllenBinTreeSet< rcu_sht, key_type, key_val, traits_EllenBinTreeSet_stat_sht > EllenBinTreeSet_rcu_sht_stat; #endif // *************************************************************************** -- 2.34.1