From: khizmax Date: Sun, 26 Oct 2014 07:49:36 +0000 (+0300) Subject: MichaelSet refactoring X-Git-Tag: v2.0.0~169 X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=0d5bb2e6accdc40b5080ab16a76de5bd71b97779;p=libcds.git MichaelSet refactoring --- diff --git a/cds/container/details/michael_set_base.h b/cds/container/details/michael_set_base.h index 8eb808ba..662dc978 100644 --- a/cds/container/details/michael_set_base.h +++ b/cds/container/details/michael_set_base.h @@ -12,30 +12,25 @@ namespace cds { namespace container { */ namespace michael_set { - /// Type traits for MichaelHashSet class (typedef for cds::intrusive::michael_set::type_traits) - typedef intrusive::michael_set::type_traits type_traits; + /// MichaelHashSet traits + typedef cds::intrusive::michael_set::traits traits; - /// Metafunction converting option list to traits struct - /** - This is a synonym for intrusive::michael_set::make_traits - */ + /// Metafunction converting option list to \p MichaelHashSet traits template - struct make_traits { - typedef typename intrusive::michael_set::make_traits::type type ; ///< Result of metafunction - }; + using make_traits = cds::intrusive::michael_set::make_traits< Options... >; //@cond namespace details { - using intrusive::michael_set::details::init_hash_bitmask; - using intrusive::michael_set::details::list_iterator_selector; - using intrusive::michael_set::details::iterator; + using cds::intrusive::michael_set::details::init_hash_bitmask; + using cds::intrusive::michael_set::details::list_iterator_selector; + using cds::intrusive::michael_set::details::iterator; } //@endcond } //@cond // Forward declarations - template + template class MichaelHashSet; //@endcond diff --git a/cds/container/michael_set.h b/cds/container/michael_set.h index 0fe47dca..76e801e9 100644 --- a/cds/container/michael_set.h +++ b/cds/container/michael_set.h @@ -23,18 +23,12 @@ namespace cds { namespace container { Template parameters are: - \p GC - Garbage collector used. You may use any \ref cds_garbage_collector "Garbage collector" from the \p libcds library. - Note the \p GC must be the same as the GC used for \p OrderedList - - \p OrderedList - ordered list implementation used as bucket for hash set, for example, MichaelList. - The ordered list implementation specifies the type \p T stored in the hash-set, the reclamation - schema \p GC used by hash-set, the comparison functor for the type \p T and other features specific for - the ordered list. - - \p Traits - type traits. See michael_set::type_traits for explanation. - - Instead of defining \p Traits struct you may use option-based syntax with michael_set::make_traits metafunction. - For michael_set::make_traits the following option may be used: - - opt::hash - mandatory option, specifies hash functor. - - opt::item_counter - optional, specifies item counting policy. See michael_set::type_traits for explanation. - - opt::allocator - optional, bucket table allocator. Default is \ref CDS_DEFAULT_ALLOCATOR. + Note the \p GC must be the same as the \p GC used for \p OrderedList + - \p OrderedList - ordered list implementation used as bucket for hash set, for example, \p MichaelList. + The ordered list implementation specifies the type \p T to be stored in the hash-set, + the comparing functor for the type \p T and other features specific for the ordered list. + - \p Traits - set traits, default is \p michael_set::traits. + Instead of defining \p Traits struct you may use option-based syntax with \p michael_set::make_traits metafunction. There are the specializations: - for \ref cds_urcu_desc "RCU" - declared in cd/container/michael_set_rcu.h, @@ -49,7 +43,7 @@ namespace cds { namespace container { It is expected that type \p Q contains full key of node type \p value_type, and if keys of type \p Q and \p value_type are equal the hash values of these keys must be equal too. - The hash functor Traits::hash should accept parameters of both type: + The hash functor \p Traits::hash should accept parameters of both type: \code // Our node type struct Foo { @@ -79,13 +73,13 @@ namespace cds { namespace container { so, the element cannot be reclaimed while the iterator object is alive. However, passing an iterator object between threads is dangerous. - \warning Due to concurrent nature of Michael's set it is not guarantee that you can iterate + @warning Due to concurrent nature of Michael's set it is not guarantee that you can iterate all elements in the set: any concurrent deletion can exclude the element pointed by the iterator from the set, and your iteration can be terminated before end of the set. Therefore, such iteration is more suitable for debugging purpose only Remember, each iterator object requires an additional hazard pointer, that may be - a limited resource for \p GC like \p gc::HP (for gc::PTB the count of + a limited resource for \p GC like \p gc::HP (for \p gc::DHP the total count of guards is unlimited). The iterator class supports the following minimalistic interface: @@ -114,7 +108,7 @@ namespace cds { namespace container { How to use - Suppose, we have the following type \p Foo that we want to store in our MichaelHashSet: + Suppose, we have the following type \p Foo that we want to store in our \p %MichaelHashSet: \code struct Foo { int nKey ; // key field @@ -123,8 +117,8 @@ namespace cds { namespace container { \endcode To use \p %MichaelHashSet for \p Foo values, you should first choose suitable ordered list class - that will be used as a bucket for the set. We will use gc::PTB reclamation schema and - MichaelList as a bucket type. Also, for ordered list we should develop a comparator for our \p Foo + that will be used as a bucket for the set. We will use \p gc::DHP reclamation schema and + \p MichaelList as a bucket type. Also, for ordered list we should develop a comparator for our \p Foo struct. \code #include @@ -143,7 +137,7 @@ namespace cds { namespace container { }; // Our ordered list - typedef cc::MichaelList< cds::gc::PTB, Foo, + typedef cc::MichaelList< cds::gc::DHP, Foo, typename cc::michael_list::make_traits< cc::opt::compare< Foo_cmp > // item comparator option >::type @@ -163,7 +157,7 @@ namespace cds { namespace container { // Declare set type. // Note that \p GC template parameter of ordered list must be equal \p GC for the set. - typedef cc::MichaelHashSet< cds::gc::PTB, bucket_list, + typedef cc::MichaelHashSet< cds::gc::DHP, bucket_list, cc::michael_set::make_traits< cc::opt::hash< foo_hash > >::type @@ -177,7 +171,7 @@ namespace cds { namespace container { class GC, class OrderedList, #ifdef CDS_DOXYGEN_INVOKED - class Traits = michael_set::type_traits + class Traits = michael_set::traits #else class Traits #endif @@ -185,27 +179,26 @@ namespace cds { namespace container { class MichaelHashSet { public: - typedef OrderedList bucket_type ; ///< type of ordered list used as a bucket implementation - typedef Traits options ; ///< Traits template parameters + typedef GC gc; ///< Garbage collector + typedef OrderedList bucket_type; ///< type of ordered list used as a bucket implementation + typedef Traits traits; ///< Set traits - typedef typename bucket_type::value_type value_type ; ///< type of value stored in the list - typedef GC gc ; ///< Garbage collector - typedef typename bucket_type::key_comparator key_comparator ; ///< key comparison functor + typedef typename bucket_type::value_type value_type; ///< type of value to be stored in the list + typedef typename bucket_type::key_comparator key_comparator; ///< key comparison functor /// Hash functor for \ref value_type and all its derivatives that you use - typedef typename cds::opt::v::hash_selector< typename options::hash >::type hash; - typedef typename options::item_counter item_counter ; ///< Item counter type + typedef typename cds::opt::v::hash_selector< typename traits::hash >::type hash; + typedef typename traits::item_counter item_counter; ///< Item counter type /// Bucket table allocator - typedef cds::details::Allocator< bucket_type, typename options::allocator > bucket_table_allocator; + typedef cds::details::Allocator< bucket_type, typename traits::allocator > bucket_table_allocator; - typedef typename bucket_type::guarded_ptr guarded_ptr; ///< Guarded pointer + typedef typename bucket_type::guarded_ptr guarded_ptr; ///< Guarded pointer protected: - item_counter m_ItemCounter ; ///< Item counter - hash m_HashFunctor ; ///< Hash functor - - bucket_type * m_Buckets ; ///< bucket table + item_counter m_ItemCounter; ///< Item counter + hash m_HashFunctor; ///< Hash functor + bucket_type * m_Buckets; ///< bucket table private: //@cond @@ -213,6 +206,7 @@ namespace cds { namespace container { //@endcond protected: + //@cond /// Calculates hash value of \p key template size_t hash_value( Q const& key ) const @@ -226,6 +220,7 @@ namespace cds { namespace container { { return m_Buckets[ hash_value( key ) ]; } + //@endcond public: /// Forward iterator @@ -292,14 +287,13 @@ namespace cds { namespace container { public: /// Initialize hash set - /** + /** @anchor cds_nonintrusive_MichaelHashSet_hp_ctor The Michael's hash set is non-expandable container. You should point the average count of items \p nMaxItemCount when you create an object. \p nLoadFactor parameter defines average count of items per bucket and it should be small number between 1 and 10. Remember, since the bucket implementation is an ordered list, searching in the bucket is linear [O(nLoadFactor)]. - Note, that many popular STL hash map implementation uses load factor 1. - The ctor defines hash table size as rounding nMacItemCount / nLoadFactor up to nearest power of two. + The ctor defines hash table size as rounding nMaxItemCount / nLoadFactor up to nearest power of two. */ MichaelHashSet( size_t nMaxItemCount, ///< estimation of max item count in the hash set @@ -307,15 +301,16 @@ namespace cds { namespace container { ) : m_nHashBitmask( michael_set::details::init_hash_bitmask( nMaxItemCount, nLoadFactor )) { // GC and OrderedList::gc must be the same - static_assert(( std::is_same::value ), "GC and OrderedList::gc must be the same"); + static_assert( std::is_same::value, "GC and OrderedList::gc must be the same"); // atomicity::empty_item_counter is not allowed as a item counter - static_assert(( !std::is_same::value ), "atomicity::empty_item_counter is not allowed as a item counter"); + static_assert( !std::is_same::value, + "cds::atomicity::empty_item_counter is not allowed as a item counter"); m_Buckets = bucket_table_allocator().NewArray( bucket_count() ); } - /// Clear hash set and destroy it + /// Clears hash set and destroys it ~MichaelHashSet() { clear(); @@ -353,10 +348,12 @@ namespace cds { namespace container { \code void func( value_type& val ); \endcode - where \p val is the item inserted. User-defined functor \p f should guarantee that during changing - \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. It may be passed by reference - using \p std::ref + where \p val is the item inserted. + The user-defined functor is called only if the inserting is success. + + @warning For \ref cds_nonintrusive_MichaelList_gc "MichaelList" as the bucket see \ref cds_intrusive_item_creating "insert item troubleshooting". + \ref cds_nonintrusive_LazyList_gc "LazyList" provides exclusive access to inserted item and does not require any node-level + synchronization. */ template bool insert( Q const& val, Func f ) @@ -373,11 +370,7 @@ namespace cds { namespace container { If the \p val key not found in the set, then the new item created from \p val is inserted into the set. Otherwise, the functor \p func is called with the item found. - The functor \p Func should be a function with signature: - \code - void func( bool bNew, value_type& item, const Q& val ); - \endcode - or a functor: + The functor \p Func signature is: \code struct my_functor { void operator()( bool bNew, value_type& item, const Q& val ); @@ -389,15 +382,16 @@ namespace cds { namespace container { - \p item - item of the set - \p val - argument \p key passed into the \p ensure function - 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. - - You may pass \p func argument by reference using \p std::ref + The functor may change non-key fields of the \p item. 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 For \ref cds_nonintrusive_MichaelList_gc "MichaelList" as the bucket see \ref cds_intrusive_item_creating "insert item troubleshooting". + \ref cds_nonintrusive_LazyList_gc "LazyList" provides exclusive access to inserted item and does not require any node-level + synchronization. + */ template std::pair ensure( const Q& val, Func func ) { @@ -407,7 +401,7 @@ namespace cds { namespace container { return bRet; } - /// Inserts data of type \ref value_type constructed with std::forward(args)... + /// Inserts data of type \p value_type constructed from \p args /** Returns \p true if inserting successful, \p false otherwise. */ @@ -464,10 +458,10 @@ namespace cds { namespace container { The functor \p Func interface: \code struct extractor { - void operator()(value_type const& val); + void operator()(value_type& item); }; \endcode - The functor may be passed by reference using boost:ref + where \p item - the item found. Since the key of %MichaelHashSet's \p value_type is not explicitly specified, template parameter \p Q defines the key type searching in the list. @@ -554,17 +548,17 @@ namespace cds { namespace container { return bRet; } - /// Finds the key \p val + /// Finds the key \p key /** \anchor cds_nonintrusive_MichaelSet_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. You may pass \p f argument by reference using \p std::ref. @@ -573,21 +567,21 @@ namespace cds { namespace container { 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 should accept a parameter of type \p Q that may be not the same as \p value_type. - 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 ) + bool find( Q& key, Func f ) { - return bucket( val ).find( val, f ); + return bucket( key ).find( key, f ); } - /// 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_MichaelSet_find_func "find(Q&, Func)" but \p pred is used for key comparing. @@ -595,69 +589,26 @@ 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 ) - { - return bucket( val ).find_with( val, pred, f ); - } - - /// Finds the key \p val - /** \anchor cds_nonintrusive_MichaelSet_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. - - You may pass \p f argument by reference using \p std::ref. - - 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 returns \p true if \p val is found, \p false otherwise. - */ - template - bool find( Q const& val, Func f ) - { - return bucket( val ).find( val, f ); - } - - /// Finds the key \p val using \p pred predicate for searching - /** - The function is an analog of \ref cds_nonintrusive_MichaelSet_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. - */ - template - bool find_with( Q const& val, Less pred, Func f ) + bool find_with( Q& key, Less pred, Func f ) { - return bucket( val ).find_with( val, pred, f ); + return bucket( key ).find_with( key, pred, f ); } - /// Finds the key \p val + /// Finds the key \p key /** \anchor cds_nonintrusive_MichaelSet_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 should accept a parameter of type \p Q that may be not the same as \ref value_type. */ template - bool find( Q const& val ) + bool find( Q const& key ) { - return bucket( val ).find( val ); + return bucket( key ).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_MichaelSet_find_val "find(Q const&)" but \p pred is used for key comparing. @@ -665,17 +616,17 @@ 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 ) + bool find_with( Q const& key, Less pred ) { - return bucket( val ).find_with( val, pred ); + return bucket( key ).find_with( key, pred ); } - /// Finds the key \p val and return the item found + /// Finds the key \p key and return the item found /** \anchor cds_nonintrusive_MichaelHashSet_hp_get - The function searches the item with key equal to \p val + The function searches the item with key equal to \p key and assigns the item found to guarded pointer \p ptr. - The function returns \p true if \p val is found, and \p false otherwise. - If \p val is not found the \p ptr parameter is not changed. + The function returns \p true if \p key is found, and \p false otherwise. + If \p key is not found the \p ptr parameter is not changed. @note Each \p guarded_ptr object uses one GC's guard which can be limited resource. @@ -698,12 +649,12 @@ namespace cds { namespace container { should accept a parameter of type \p Q that can be not the same as \p value_type. */ template - bool get( guarded_ptr& ptr, Q const& val ) + bool get( guarded_ptr& ptr, Q const& key ) { - return bucket( val ).get( ptr, val ); + return bucket( key ).get( ptr, key ); } - /// Finds the key \p val and return the item found + /// Finds the key \p key and return the item found /** The function is an analog of \ref cds_nonintrusive_MichaelHashSet_hp_get "get( guarded_ptr& ptr, Q const&)" but \p pred is used for comparing the keys. @@ -713,9 +664,9 @@ namespace cds { namespace container { \p pred must imply the same element order as the comparator used for building the set. */ template - bool get_with( guarded_ptr& ptr, Q const& val, Less pred ) + bool get_with( guarded_ptr& ptr, Q const& key, Less pred ) { - return bucket( val ).get_with( ptr, val, pred ); + return bucket( key ).get_with( ptr, key, pred ); } /// Clears the set (non-atomic) diff --git a/cds/container/michael_set_nogc.h b/cds/container/michael_set_nogc.h index 0f241260..326c602e 100644 --- a/cds/container/michael_set_nogc.h +++ b/cds/container/michael_set_nogc.h @@ -13,51 +13,48 @@ namespace cds { namespace container { /** @ingroup cds_nonintrusive_set \anchor cds_nonintrusive_MichaelHashSet_nogc - This specialization is intended for so-called persistent usage when no item + This specialization is so-called append-only when no item reclamation may be performed. The class does not support deleting of list item. See \ref cds_nonintrusive_MichaelHashSet_hp "MichaelHashSet" for description of template parameters. - The template parameter \p OrderedList should be any gc::nogc-derived ordered list, for example, - \ref cds_nonintrusive_MichaelList_nogc "persistent MichaelList". - - The interface of the specialization is a slightly different. + The template parameter \p OrderedList should be any \p gc::nogc -derived ordered list, for example, + \ref cds_nonintrusive_MichaelList_nogc "append-only MichaelList". */ template < class OrderedList, #ifdef CDS_DOXYGEN_INVOKED - class Traits = michael_set::type_traits + class Traits = michael_set::traits #else class Traits #endif > - class MichaelHashSet< gc::nogc, OrderedList, Traits > + class MichaelHashSet< cds::gc::nogc, OrderedList, Traits > { public: - typedef OrderedList bucket_type ; ///< type of ordered list used as a bucket implementation - typedef Traits options ; ///< Traits template parameters + typedef cds::gc::nogc gc; ///< Garbage collector + typedef OrderedList bucket_type; ///< type of ordered list to be used as a bucket implementation + typedef Traits traits; ///< Set traits - typedef typename bucket_type::value_type value_type ; ///< type of value stored in the list - typedef gc::nogc gc ; ///< Garbage collector - typedef typename bucket_type::key_comparator key_comparator ; ///< key comparison functor + typedef typename bucket_type::value_type value_type; ///< type of value stored in the list + typedef typename bucket_type::key_comparator key_comparator; ///< key comparison functor /// Hash functor for \ref value_type and all its derivatives that you use - typedef typename cds::opt::v::hash_selector< typename options::hash >::type hash; - typedef typename options::item_counter item_counter ; ///< Item counter type + typedef typename cds::opt::v::hash_selector< typename traits::hash >::type hash; + typedef typename traits::item_counter item_counter; ///< Item counter type /// Bucket table allocator - typedef cds::details::Allocator< bucket_type, typename options::allocator > bucket_table_allocator; + typedef cds::details::Allocator< bucket_type, typename traits::allocator > bucket_table_allocator; protected: //@cond - typedef typename bucket_type::iterator bucket_iterator; - typedef typename bucket_type::const_iterator bucket_const_iterator; + typedef typename bucket_type::iterator bucket_iterator; + typedef typename bucket_type::const_iterator bucket_const_iterator; //@endcond protected: - item_counter m_ItemCounter ; ///< Item counter - hash m_HashFunctor ; ///< Hash functor - - bucket_type * m_Buckets ; ///< bucket table + item_counter m_ItemCounter; ///< Item counter + hash m_HashFunctor; ///< Hash functor + bucket_type * m_Buckets; ///< bucket table private: //@cond @@ -65,6 +62,7 @@ namespace cds { namespace container { //@endcond protected: + //@cond /// Calculates hash value of \p key template size_t hash_value( const Q& key ) const @@ -78,6 +76,7 @@ namespace cds { namespace container { { return m_Buckets[ hash_value( key ) ]; } + //@endcond public: /// Forward iterator @@ -139,7 +138,7 @@ namespace cds { namespace container { //@} private: - //@{ + //@cond const_iterator get_const_begin() const { return const_iterator( const_cast(m_Buckets[0]).begin(), m_Buckets, m_Buckets + bucket_count() ); @@ -148,12 +147,11 @@ namespace cds { namespace container { { return const_iterator( const_cast(m_Buckets[bucket_count() - 1]).end(), m_Buckets + bucket_count() - 1, m_Buckets + bucket_count() ); } - //@} + //@endcond public: /// Initialize hash set - /** - See \ref cds_nonintrusive_MichaelHashSet_hp "MichaelHashSet" ctor for explanation + /** @copydetails cds_nonintrusive_MichaelHashSet_hp_ctor */ MichaelHashSet( size_t nMaxItemCount, ///< estimation of max item count in the hash set @@ -161,15 +159,16 @@ namespace cds { namespace container { ) : m_nHashBitmask( michael_set::details::init_hash_bitmask( nMaxItemCount, nLoadFactor )) { // GC and OrderedList::gc must be the same - static_assert(( std::is_same::value ), "GC and OrderedList::gc must be the same"); + static_assert( std::is_same::value, "GC and OrderedList::gc must be the same"); // atomicity::empty_item_counter is not allowed as a item counter - static_assert(( !std::is_same::value ), "atomicity::empty_item_counter is not allowed as a item counter"); + static_assert( !std::is_same::value, + "cds::atomicity::empty_item_counter is not allowed as a item counter"); m_Buckets = bucket_table_allocator().NewArray( bucket_count() ); } - /// Clear hash set and destroy it + /// Clears hash set and destroys it ~MichaelHashSet() { clear(); @@ -220,9 +219,13 @@ namespace cds { namespace container { The operation inserts new item if the key \p val is not found in the set. Otherwise, the function returns an iterator that points to item found. - Returns std::pair where \p first is an iterator pointing to + Returns std::pair where \p first is an iterator pointing to item found or inserted, \p second is true if new item has been added or \p false if the item already is in the set. + + @warning For \ref cds_nonintrusive_MichaelList_nogc "MichaelList" as the bucket see \ref cds_intrusive_item_creating "insert item troubleshooting". + \ref cds_nonintrusive_LazyList_nogc "LazyList" provides exclusive access to inserted item and does not require any node-level + synchronization. */ template std::pair ensure( const Q& val ) @@ -274,15 +277,7 @@ namespace cds { namespace container { return end(); } - - /// Clears the set (non-atomic, not thread-safe) - /** - The function deletes all items from the set. - The function is not atomic and even not thread-safe. - It cleans up each bucket and then resets the item counter to zero. - If there are a thread that performs insertion while \p clear is working the result is undefined in general case: - empty() may return \p true but the set may contain item(s). - */ + /// Clears the set (not atomic) void clear() { for ( size_t i = 0; i < bucket_count(); ++i ) @@ -290,10 +285,9 @@ namespace cds { namespace container { m_ItemCounter.reset(); } - /// Checks if the set is empty /** - Emptiness is checked by item counting: if item count is zero then the set is empty. + The emptiness is checked by the item counting: if item count is zero then the set is empty. Thus, the correct item counting feature is an important part of Michael's set implementation. */ bool empty() const @@ -309,7 +303,7 @@ namespace cds { namespace container { /// Returns the size of hash table /** - Since MichaelHashSet cannot dynamically extend the hash table size, + Since \p %MichaelHashSet cannot dynamically extend the hash table size, the value returned is an constant depending on object initialization parameters; see MichaelHashSet::MichaelHashSet for explanation. */ diff --git a/cds/container/michael_set_rcu.h b/cds/container/michael_set_rcu.h index 8f9446d1..95ee8fd8 100644 --- a/cds/container/michael_set_rcu.h +++ b/cds/container/michael_set_rcu.h @@ -22,23 +22,19 @@ namespace cds { namespace container { Template parameters are: - \p RCU - one of \ref cds_urcu_gc "RCU type" - - \p OrderedList - ordered list implementation used as bucket for hash set, for example, MichaelList. + - \p OrderedList - ordered list implementation used as the bucket for hash set, for example, + \ref cds_nonintrusive_MichaelList_rcu "MichaelList". The ordered list implementation specifies the type \p T stored in the hash-set, the comparison functor for the type \p T and other features specific for the ordered list. - - \p Traits - type traits. See michael_set::type_traits for explanation. + - \p Traits - set traits, default is michael_set::traits. + Instead of defining \p Traits struct you may use option-based syntax with michael_set::make_traits metafunction. - Instead of defining \p Traits struct you may use option-based syntax with michael_set::make_traits metafunction. - For michael_set::make_traits the following option may be used: - - opt::hash - mandatory option, specifies hash functor. - - opt::item_counter - optional, specifies item counting policy. See michael_set::type_traits for explanation. - - opt::allocator - optional, bucket table allocator. Default is \ref CDS_DEFAULT_ALLOCATOR. - - \note About hash functor see \ref cds_nonintrusive_MichaelHashSet_hash_functor "MichaelSet". + About hash functor see \ref cds_nonintrusive_MichaelHashSet_hash_functor "MichaelSet hash functor". How to use - Suppose, we have the following type \p Foo that we want to store in our MichaelHashSet: + Suppose, we have the following type \p Foo that we want to store in your \p %MichaelHashSet: \code struct Foo { int nKey ; // key field @@ -69,7 +65,7 @@ namespace cds { namespace container { } }; - // Our ordered list + // Ordered list typedef cc::MichaelList< cds::urcu::gc< cds::urcu::general_buffered<> >, Foo, typename cc::michael_list::make_traits< cc::opt::compare< Foo_cmp > // item comparator option @@ -88,7 +84,7 @@ namespace cds { namespace container { } }; - // Declare set type. + // Declare the set // Note that \p RCU template parameter of ordered list must be equal \p RCU for the set. typedef cc::MichaelHashSet< cds::urcu::gc< cds::urcu::general_buffered<> >, bucket_list, cc::michael_set::make_traits< @@ -96,7 +92,6 @@ namespace cds { namespace container { >::type > foo_set; - // Set variable foo_set fooSet; \endcode */ @@ -104,7 +99,7 @@ namespace cds { namespace container { class RCU, class OrderedList, #ifdef CDS_DOXYGEN_INVOKED - class Traits = michael_set::type_traits + class Traits = michael_set::traits #else class Traits #endif @@ -112,30 +107,29 @@ namespace cds { namespace container { class MichaelHashSet< cds::urcu::gc< RCU >, OrderedList, Traits > { public: - typedef OrderedList bucket_type ; ///< type of ordered list used as a bucket implementation - typedef Traits options ; ///< Traits template parameters + typedef cds::urcu::gc< RCU > gc; ///< RCU used as garbage collector + typedef OrderedList bucket_type; ///< type of ordered list to be used as a bucket implementation + typedef Traits traits; ///< Set traits - typedef typename bucket_type::value_type value_type ; ///< type of value stored in the list - typedef cds::urcu::gc< RCU > gc ; ///< RCU used as garbage collector - typedef typename bucket_type::key_comparator key_comparator ; ///< key comparing functor + typedef typename bucket_type::value_type value_type; ///< type of value to be stored in the list + typedef typename bucket_type::key_comparator key_comparator; ///< key comparing functor /// Hash functor for \ref value_type and all its derivatives that you use - typedef typename cds::opt::v::hash_selector< typename options::hash >::type hash; - typedef typename options::item_counter item_counter ; ///< Item counter type + typedef typename cds::opt::v::hash_selector< typename traits::hash >::type hash; + typedef typename traits::item_counter item_counter; ///< Item counter type /// Bucket table allocator - typedef cds::details::Allocator< bucket_type, typename options::allocator > bucket_table_allocator; + typedef cds::details::Allocator< bucket_type, typename traits::allocator > bucket_table_allocator; - typedef typename bucket_type::rcu_lock rcu_lock ; ///< RCU scoped lock - typedef typename bucket_type::exempt_ptr exempt_ptr ; ///< pointer to extracted node + typedef typename bucket_type::rcu_lock rcu_lock; ///< RCU scoped lock + typedef typename bucket_type::exempt_ptr exempt_ptr; ///< pointer to extracted node /// Group of \p extract_xxx functions require external locking if underlying ordered list requires that static CDS_CONSTEXPR const bool c_bExtractLockExternal = bucket_type::c_bExtractLockExternal; protected: - item_counter m_ItemCounter ; ///< Item counter - hash m_HashFunctor ; ///< Hash functor - - bucket_type * m_Buckets ; ///< bucket table + item_counter m_ItemCounter; ///< Item counter + hash m_HashFunctor; ///< Hash functor + bucket_type * m_Buckets; ///< bucket table private: //@cond @@ -143,6 +137,7 @@ namespace cds { namespace container { //@endcond protected: + //@cond /// Calculates hash value of \p key template size_t hash_value( Q const& key ) const @@ -151,7 +146,6 @@ namespace cds { namespace container { } /// Returns the bucket (ordered list) for \p key - //@{ template bucket_type& bucket( Q const& key ) { @@ -162,7 +156,7 @@ namespace cds { namespace container { { return m_Buckets[ hash_value( key ) ]; } - //@} + //@endcond public: /// Forward iterator /** @@ -239,14 +233,7 @@ namespace cds { namespace container { public: /// Initialize hash set - /** - The Michael's hash set is non-expandable container. You should point the average count of items \p nMaxItemCount - when you create an object. - \p nLoadFactor parameter defines average count of items per bucket and it should be small number between 1 and 10. - Remember, since the bucket implementation is an ordered list, searching in the bucket is linear [O(nLoadFactor)]. - Note, that many popular STL hash map implementation uses load factor 1. - - The ctor defines hash table size as rounding nMacItemCount / nLoadFactor up to nearest power of two. + /** @copydetails cds_nonintrusive_MichaelHashSet_hp_ctor */ MichaelHashSet( size_t nMaxItemCount, ///< estimation of max item count in the hash set @@ -254,15 +241,16 @@ namespace cds { namespace container { ) : m_nHashBitmask( michael_set::details::init_hash_bitmask( nMaxItemCount, nLoadFactor )) { // GC and OrderedList::gc must be the same - static_assert(( std::is_same::value ), "GC and OrderedList::gc must be the same"); + static_assert( std::is_same::value, "GC and OrderedList::gc must be the same"); // atomicity::empty_item_counter is not allowed as a item counter - static_assert(( !std::is_same::value ), "atomicity::empty_item_counter is not allowed as a item counter"); + static_assert( !std::is_same::value, + "atomicity::empty_item_counter is not allowed as a item counter"); m_Buckets = bucket_table_allocator().NewArray( bucket_count() ); } - /// Clear hash set and destroy it + /// Clears hash set and destroys it ~MichaelHashSet() { clear(); @@ -302,13 +290,15 @@ namespace cds { namespace container { \code void func( value_type& val ); \endcode - where \p val is the item inserted. User-defined functor \p f should guarantee that during changing - \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. It may be passed by reference - using \p std::ref + where \p val is the item inserted. + The user-defined functor is called only if the inserting is success. The function applies RCU lock internally. - */ + + @warning For \ref cds_nonintrusive_MichaelList_rcu "MichaelList" as the bucket see \ref cds_intrusive_item_creating "insert item troubleshooting". + \ref cds_nonintrusive_LazyList_rcu "LazyList" provides exclusive access to inserted item and does not require any node-level + synchronization. + */ template bool insert( Q const& val, Func f ) { @@ -324,11 +314,7 @@ namespace cds { namespace container { If the \p val key not found in the set, then the new item created from \p val is inserted into the set. Otherwise, the functor \p func is called with the item found. - The functor \p Func should be a function with signature: - \code - void func( bool bNew, value_type& item, const Q& val ); - \endcode - or a functor: + The functor \p Func signature is: \code struct my_functor { void operator()( bool bNew, value_type& item, const Q& val ); @@ -340,16 +326,17 @@ namespace cds { namespace container { - \p item - item of the set - \p val - argument \p key passed into the \p ensure function - 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. - - You may pass \p func argument by reference using \p std::ref + The functor may change non-key fields of the \p item. The function applies RCU lock internally. 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 For \ref cds_nonintrusive_MichaelList_rcu "MichaelList" as the bucket see \ref cds_intrusive_item_creating "insert item troubleshooting". + \ref cds_nonintrusive_LazyList_rcu "LazyList" provides exclusive access to inserted item and does not require any node-level + synchronization. */ template std::pair ensure( const Q& val, Func func ) @@ -360,7 +347,7 @@ namespace cds { namespace container { return bRet; } - /// Inserts data of type \ref value_type constructed with std::forward(args)... + /// Inserts data of type \p value_type created from \p args /** Returns \p true if inserting successful, \p false otherwise. @@ -378,7 +365,7 @@ namespace cds { namespace container { /// Deletes \p key from the set /** \anchor cds_nonintrusive_MichealSet_rcu_erase_val - Since the key of MichaelHashSet's item type \ref value_type is not explicitly specified, + Since the key of MichaelHashSet's item type \p value_type is not explicitly specified, template parameter \p Q defines the key type searching in the list. The set item comparator should be able to compare the type \p value_type and the type \p Q. @@ -424,7 +411,6 @@ namespace cds { namespace container { void operator()(value_type const& val); }; \endcode - The functor may be passed by reference using boost:ref Since the key of %MichaelHashSet's \p value_type is not explicitly specified, template parameter \p Q defines the key type searching in the list. @@ -462,9 +448,9 @@ namespace cds { namespace container { /// Extracts an item from the set /** \anchor cds_nonintrusive_MichaelHashSet_rcu_extract - The function searches an item with key equal to \p val in the set, + The function searches an item with key equal to \p key in the set, unlinks it from the set, places item pointer into \p dest argument, and returns \p true. - If the item with the key equal to \p val is not found the function return \p false. + If the item with the key equal to \p key is not found the function return \p false. @note The function does NOT call RCU read-side lock or synchronization, and does NOT dispose the item found. It just excludes the item from the set @@ -503,9 +489,9 @@ namespace cds { namespace container { \endcode */ template - bool extract( exempt_ptr& dest, Q const& val ) + bool extract( exempt_ptr& dest, Q const& key ) { - if ( bucket( val ).extract( dest, val )) { + if ( bucket( key ).extract( dest, key )) { --m_ItemCounter; return true; } @@ -520,35 +506,33 @@ namespace cds { namespace container { \p pred must imply the same element order as the comparator used for building the set. */ template - bool extract_with( exempt_ptr& dest, Q const& val, Less pred ) + bool extract_with( exempt_ptr& dest, Q const& key, Less pred ) { - if ( bucket( val ).extract_with( dest, val, pred )) { + if ( bucket( key ).extract_with( dest, key, pred )) { --m_ItemCounter; return true; } return false; } - /// Finds the key \p val + /// Finds the key \p key /** \anchor cds_nonintrusive_MichealSet_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. - - You may pass \p f argument by reference using \p std::ref. + 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 @@ -556,15 +540,15 @@ 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 bucket( val ).find( val, f ); + return bucket( key ).find( key, f ); } - /// 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_MichealSet_rcu_find_func "find(Q&, Func)" but \p pred is used for key comparing. @@ -572,72 +556,27 @@ 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 bucket( val ).find_with( val, pred, f ); + return bucket( key ).find_with( key, pred, f ); } - /// Finds the key \p val - /** \anchor cds_nonintrusive_MichealSet_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. - - You may pass \p f argument by reference using \p std::ref. - - 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 bucket( val ).find( val, f ); - } - - /// Finds the key \p val using \p pred predicate for searching - /** - The function is an analog of \ref cds_nonintrusive_MichealSet_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. - */ - template - bool find_with( Q const& val, Less pred, Func f ) const - { - return bucket( val ).find_with( val, pred, f ); - } - - /// Finds the key \p val + /// Finds the key \p key /** \anchor cds_nonintrusive_MichealSet_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 - should accept a parameter of type \p Q that may be not the same as \ref value_type. + should accept a parameter of type \p Q that may be not the same as \p value_type. */ template - bool find( Q const & val ) const + bool find( Q const & key ) const { - return bucket( val ).find( val ); + return bucket( key ).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_MichealSet_rcu_find_val "find(Q const&)" but \p pred is used for key comparing. @@ -645,15 +584,15 @@ 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 bucket( val ).find_with( val, pred ); + return bucket( key ).find_with( key, pred ); } - /// Finds the key \p val and return the item found + /// Finds the key \p key and return the item found /** \anchor cds_nonintrusive_MichaelHashSet_rcu_get - The function searches the item with key equal to \p val and returns the pointer to item found. - If \p val is not found it returns \p nullptr. + The function searches the item with key equal to \p key and returns the pointer to item found. + If \p key is not found it returns \p nullptr. Note the compare functor should accept a parameter of type \p Q that can be not the same as \p value_type. @@ -678,12 +617,12 @@ namespace cds { namespace container { \endcode */ template - value_type * get( Q const& val ) const + value_type * get( Q const& key ) const { - return bucket( val ).get( val ); + return bucket( key ).get( key ); } - /// Finds the key \p val and return the item found + /// Finds the key \p key and return the item found /** The function is an analog of \ref cds_nonintrusive_MichaelHashSet_rcu_get "get(Q const&)" but \p pred is used for comparing the keys. @@ -693,22 +632,12 @@ namespace cds { namespace container { \p pred must imply the same element order as the comparator used for building the set. */ template - value_type * get_with( Q const& val, Less pred ) const + value_type * get_with( Q const& key, Less pred ) const { - return bucket( val ).get_with( val, pred ); + return bucket( key ).get_with( key, pred ); } - /// Clears the set (non-atomic) - /** - The function erases all items from the set. - - The function is not atomic. It cleans up each bucket and then resets the item counter to zero. - If there are a thread that performs insertion while \p clear is working the result is undefined in general case: - empty() may return \p true but the set may contain item(s). - Therefore, \p clear may be used only for debugging purposes. - - RCU \p synchronize method can be called. RCU should not be locked. - */ + /// Clears the set (not atomic) void clear() { for ( size_t i = 0; i < bucket_count(); ++i ) @@ -734,7 +663,7 @@ namespace cds { namespace container { /// Returns the size of hash table /** - Since MichaelHashSet cannot dynamically extend the hash table size, + Since \p %MichaelHashSet cannot dynamically extend the hash table size, the value returned is an constant depending on object initialization parameters; see MichaelHashSet::MichaelHashSet for explanation. */ @@ -746,4 +675,4 @@ namespace cds { namespace container { }} // namespace cds::container -#endif // ifndef __CDS_CONTAINER_MICHAEL_SET_H +#endif // ifndef __CDS_CONTAINER_MICHAEL_SET_RCU_H diff --git a/projects/Win/vc12/hdr-test-set.vcxproj b/projects/Win/vc12/hdr-test-set.vcxproj index 1f6e998d..012a7c76 100644 --- a/projects/Win/vc12/hdr-test-set.vcxproj +++ b/projects/Win/vc12/hdr-test-set.vcxproj @@ -591,17 +591,17 @@ + + - - diff --git a/projects/Win/vc12/hdr-test-set.vcxproj.filters b/projects/Win/vc12/hdr-test-set.vcxproj.filters index 5fe49abc..ca24563b 100644 --- a/projects/Win/vc12/hdr-test-set.vcxproj.filters +++ b/projects/Win/vc12/hdr-test-set.vcxproj.filters @@ -134,12 +134,6 @@ container\michael_set - - container\michael_set - - - container\michael_set - container\michael_set @@ -149,9 +143,6 @@ container\michael_set - - container\michael_set - container\michael_set @@ -311,5 +302,14 @@ intrusive\michael_set + + container\michael_set + + + container\michael_set + + + container\michael_set + \ No newline at end of file diff --git a/tests/test-hdr/set/hdr_michael_set_dhp.cpp b/tests/test-hdr/set/hdr_michael_set_dhp.cpp new file mode 100644 index 00000000..fe35856c --- /dev/null +++ b/tests/test-hdr/set/hdr_michael_set_dhp.cpp @@ -0,0 +1,88 @@ +//$$CDS-header$$ + +#include "set/hdr_set.h" +#include +#include + +namespace set { + + namespace { + struct set_traits: public cc::michael_set::traits + { + typedef HashSetHdrTest::hash_int hash; + typedef HashSetHdrTest::simple_item_counter item_counter; + }; + + struct DHP_cmp_traits: public cc::michael_list::traits + { + typedef HashSetHdrTest::cmp compare; + }; + + struct DHP_less_traits: public cc::michael_list::traits + { + typedef HashSetHdrTest::less less; + }; + + struct DHP_cmpmix_traits: public cc::michael_list::traits + { + typedef HashSetHdrTest::cmp compare; + typedef HashSetHdrTest::less less; + }; + } + + void HashSetHdrTest::Michael_DHP_cmp() + { + typedef cc::MichaelList< cds::gc::DHP, item, DHP_cmp_traits > list; + + // traits-based version + typedef cc::MichaelHashSet< cds::gc::DHP, list, set_traits > set; + test_int< set >(); + + // option-based version + typedef cc::MichaelHashSet< cds::gc::DHP, list, + cc::michael_set::make_traits< + cc::opt::hash< hash_int > + ,cc::opt::item_counter< simple_item_counter > + >::type + > opt_set; + test_int< opt_set >(); + } + + void HashSetHdrTest::Michael_DHP_less() + { + typedef cc::MichaelList< cds::gc::DHP, item, DHP_less_traits > list; + + // traits-based version + typedef cc::MichaelHashSet< cds::gc::DHP, list, set_traits > set; + test_int< set >(); + + // option-based version + typedef cc::MichaelHashSet< cds::gc::DHP, list, + cc::michael_set::make_traits< + cc::opt::hash< hash_int > + ,cc::opt::item_counter< simple_item_counter > + >::type + > opt_set; + test_int< opt_set >(); + } + + void HashSetHdrTest::Michael_DHP_cmpmix() + { + typedef cc::MichaelList< cds::gc::DHP, item, DHP_cmpmix_traits > list; + + // traits-based version + typedef cc::MichaelHashSet< cds::gc::DHP, list, set_traits > set; + test_int< set >(); + + // option-based version + typedef cc::MichaelHashSet< cds::gc::DHP, list, + cc::michael_set::make_traits< + cc::opt::hash< hash_int > + ,cc::opt::item_counter< simple_item_counter > + >::type + > opt_set; + test_int< opt_set >(); + } + + +} // namespace set diff --git a/tests/test-hdr/set/hdr_michael_set_hp.cpp b/tests/test-hdr/set/hdr_michael_set_hp.cpp index db54bd22..400fa6c7 100644 --- a/tests/test-hdr/set/hdr_michael_set_hp.cpp +++ b/tests/test-hdr/set/hdr_michael_set_hp.cpp @@ -7,23 +7,23 @@ namespace set { namespace { - struct set_traits: public cc::michael_set::type_traits + struct set_traits: public cc::michael_set::traits { typedef HashSetHdrTest::hash_int hash; typedef HashSetHdrTest::simple_item_counter item_counter; }; - struct HP_cmp_traits: public cc::michael_list::type_traits + struct HP_cmp_traits: public cc::michael_list::traits { typedef HashSetHdrTest::cmp compare; }; - struct HP_less_traits: public cc::michael_list::type_traits + struct HP_less_traits: public cc::michael_list::traits { typedef HashSetHdrTest::less less; }; - struct HP_cmpmix_traits: public cc::michael_list::type_traits + struct HP_cmpmix_traits: public cc::michael_list::traits { typedef HashSetHdrTest::cmp compare; typedef HashSetHdrTest::less less; diff --git a/tests/test-hdr/set/hdr_michael_set_lazy_dhp.cpp b/tests/test-hdr/set/hdr_michael_set_lazy_dhp.cpp new file mode 100644 index 00000000..ad4e924e --- /dev/null +++ b/tests/test-hdr/set/hdr_michael_set_lazy_dhp.cpp @@ -0,0 +1,88 @@ +//$$CDS-header$$ + +#include "set/hdr_set.h" +#include +#include + +namespace set { + + namespace { + struct set_traits: public cc::michael_set::traits + { + typedef HashSetHdrTest::hash_int hash; + typedef HashSetHdrTest::simple_item_counter item_counter; + }; + + struct DHP_cmp_traits: public cc::lazy_list::traits + { + typedef HashSetHdrTest::cmp compare; + }; + + struct DHP_less_traits: public cc::lazy_list::traits + { + typedef HashSetHdrTest::less less; + }; + + struct DHP_cmpmix_traits: public cc::lazy_list::traits + { + typedef HashSetHdrTest::cmp compare; + typedef HashSetHdrTest::less less; + }; + } + + void HashSetHdrTest::Lazy_DHP_cmp() + { + typedef cc::LazyList< cds::gc::DHP, item, DHP_cmp_traits > list; + + // traits-based version + typedef cc::MichaelHashSet< cds::gc::DHP, list, set_traits > set; + test_int< set >(); + + // option-based version + typedef cc::MichaelHashSet< cds::gc::DHP, list, + cc::michael_set::make_traits< + cc::opt::hash< hash_int > + ,cc::opt::item_counter< simple_item_counter > + >::type + > opt_set; + test_int< opt_set >(); + } + + void HashSetHdrTest::Lazy_DHP_less() + { + typedef cc::LazyList< cds::gc::DHP, item, DHP_less_traits > list; + + // traits-based version + typedef cc::MichaelHashSet< cds::gc::DHP, list, set_traits > set; + test_int< set >(); + + // option-based version + typedef cc::MichaelHashSet< cds::gc::DHP, list, + cc::michael_set::make_traits< + cc::opt::hash< hash_int > + ,cc::opt::item_counter< simple_item_counter > + >::type + > opt_set; + test_int< opt_set >(); + } + + void HashSetHdrTest::Lazy_DHP_cmpmix() + { + typedef cc::LazyList< cds::gc::DHP, item, DHP_cmpmix_traits > list; + + // traits-based version + typedef cc::MichaelHashSet< cds::gc::DHP, list, set_traits > set; + test_int< set >(); + + // option-based version + typedef cc::MichaelHashSet< cds::gc::DHP, list, + cc::michael_set::make_traits< + cc::opt::hash< hash_int > + ,cc::opt::item_counter< simple_item_counter > + >::type + > opt_set; + test_int< opt_set >(); + } + + +} // namespace set diff --git a/tests/test-hdr/set/hdr_michael_set_lazy_hp.cpp b/tests/test-hdr/set/hdr_michael_set_lazy_hp.cpp index c8fa8dca..066e1b7d 100644 --- a/tests/test-hdr/set/hdr_michael_set_lazy_hp.cpp +++ b/tests/test-hdr/set/hdr_michael_set_lazy_hp.cpp @@ -7,23 +7,23 @@ namespace set { namespace { - struct set_traits: public cc::michael_set::type_traits + struct set_traits: public cc::michael_set::traits { typedef HashSetHdrTest::hash_int hash; typedef HashSetHdrTest::simple_item_counter item_counter; }; - struct HP_cmp_traits: public cc::lazy_list::type_traits + struct HP_cmp_traits: public cc::lazy_list::traits { typedef HashSetHdrTest::cmp compare; }; - struct HP_less_traits: public cc::lazy_list::type_traits + struct HP_less_traits: public cc::lazy_list::traits { typedef HashSetHdrTest::less less; }; - struct HP_cmpmix_traits: public cc::lazy_list::type_traits + struct HP_cmpmix_traits: public cc::lazy_list::traits { typedef HashSetHdrTest::cmp compare; typedef HashSetHdrTest::less less; diff --git a/tests/test-hdr/set/hdr_michael_set_lazy_nogc.cpp b/tests/test-hdr/set/hdr_michael_set_lazy_nogc.cpp index 7d424a00..4d988f43 100644 --- a/tests/test-hdr/set/hdr_michael_set_lazy_nogc.cpp +++ b/tests/test-hdr/set/hdr_michael_set_lazy_nogc.cpp @@ -7,23 +7,23 @@ namespace set { namespace { - struct set_traits: public cc::michael_set::type_traits + struct set_traits: public cc::michael_set::traits { typedef HashSetHdrTest::hash_int hash; typedef HashSetHdrTest::simple_item_counter item_counter; }; - struct nogc_cmp_traits: public cc::lazy_list::type_traits + struct nogc_cmp_traits: public cc::lazy_list::traits { typedef HashSetHdrTest::cmp compare; }; - struct nogc_less_traits: public cc::lazy_list::type_traits + struct nogc_less_traits: public cc::lazy_list::traits { typedef HashSetHdrTest::less less; }; - struct nogc_cmpmix_traits: public cc::lazy_list::type_traits + struct nogc_cmpmix_traits: public cc::lazy_list::traits { typedef HashSetHdrTest::cmp compare; typedef HashSetHdrTest::less less; diff --git a/tests/test-hdr/set/hdr_michael_set_lazy_ptb.cpp b/tests/test-hdr/set/hdr_michael_set_lazy_ptb.cpp deleted file mode 100644 index b8c3136f..00000000 --- a/tests/test-hdr/set/hdr_michael_set_lazy_ptb.cpp +++ /dev/null @@ -1,88 +0,0 @@ -//$$CDS-header$$ - -#include "set/hdr_set.h" -#include -#include - -namespace set { - - namespace { - struct set_traits: public cc::michael_set::type_traits - { - typedef HashSetHdrTest::hash_int hash; - typedef HashSetHdrTest::simple_item_counter item_counter; - }; - - struct PTB_cmp_traits: public cc::lazy_list::type_traits - { - typedef HashSetHdrTest::cmp compare; - }; - - struct PTB_less_traits: public cc::lazy_list::type_traits - { - typedef HashSetHdrTest::less less; - }; - - struct PTB_cmpmix_traits: public cc::lazy_list::type_traits - { - typedef HashSetHdrTest::cmp compare; - typedef HashSetHdrTest::less less; - }; - } - - void HashSetHdrTest::Lazy_PTB_cmp() - { - typedef cc::LazyList< cds::gc::PTB, item, PTB_cmp_traits > list; - - // traits-based version - typedef cc::MichaelHashSet< cds::gc::PTB, list, set_traits > set; - test_int< set >(); - - // option-based version - typedef cc::MichaelHashSet< cds::gc::PTB, list, - cc::michael_set::make_traits< - cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - >::type - > opt_set; - test_int< opt_set >(); - } - - void HashSetHdrTest::Lazy_PTB_less() - { - typedef cc::LazyList< cds::gc::PTB, item, PTB_less_traits > list; - - // traits-based version - typedef cc::MichaelHashSet< cds::gc::PTB, list, set_traits > set; - test_int< set >(); - - // option-based version - typedef cc::MichaelHashSet< cds::gc::PTB, list, - cc::michael_set::make_traits< - cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - >::type - > opt_set; - test_int< opt_set >(); - } - - void HashSetHdrTest::Lazy_PTB_cmpmix() - { - typedef cc::LazyList< cds::gc::PTB, item, PTB_cmpmix_traits > list; - - // traits-based version - typedef cc::MichaelHashSet< cds::gc::PTB, list, set_traits > set; - test_int< set >(); - - // option-based version - typedef cc::MichaelHashSet< cds::gc::PTB, list, - cc::michael_set::make_traits< - cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - >::type - > opt_set; - test_int< opt_set >(); - } - - -} // namespace set diff --git a/tests/test-hdr/set/hdr_michael_set_lazy_rcu_gpb.cpp b/tests/test-hdr/set/hdr_michael_set_lazy_rcu_gpb.cpp index 82238d58..8b2234b2 100644 --- a/tests/test-hdr/set/hdr_michael_set_lazy_rcu_gpb.cpp +++ b/tests/test-hdr/set/hdr_michael_set_lazy_rcu_gpb.cpp @@ -10,23 +10,23 @@ namespace set { namespace { typedef cds::urcu::gc< cds::urcu::general_buffered<> > rcu_type; - struct set_traits: public cc::michael_set::type_traits + struct set_traits: public cc::michael_set::traits { typedef HashSetHdrTest::hash_int hash; typedef HashSetHdrTest::simple_item_counter item_counter; }; - struct RCU_GPB_cmp_traits: public cc::lazy_list::type_traits + struct RCU_GPB_cmp_traits: public cc::lazy_list::traits { typedef HashSetHdrTest::cmp compare; }; - struct RCU_GPB_less_traits: public cc::lazy_list::type_traits + struct RCU_GPB_less_traits: public cc::lazy_list::traits { typedef HashSetHdrTest::less less; }; - struct RCU_GPB_cmpmix_traits: public cc::lazy_list::type_traits + struct RCU_GPB_cmpmix_traits: public cc::lazy_list::traits { typedef HashSetHdrTest::cmp compare; typedef HashSetHdrTest::less less; diff --git a/tests/test-hdr/set/hdr_michael_set_lazy_rcu_gpi.cpp b/tests/test-hdr/set/hdr_michael_set_lazy_rcu_gpi.cpp index 1ea98e85..8e9933e9 100644 --- a/tests/test-hdr/set/hdr_michael_set_lazy_rcu_gpi.cpp +++ b/tests/test-hdr/set/hdr_michael_set_lazy_rcu_gpi.cpp @@ -10,23 +10,23 @@ namespace set { namespace { typedef cds::urcu::gc< cds::urcu::general_instant<> > rcu_type; - struct set_traits: public cc::michael_set::type_traits + struct set_traits: public cc::michael_set::traits { typedef HashSetHdrTest::hash_int hash; typedef HashSetHdrTest::simple_item_counter item_counter; }; - struct RCU_GPI_cmp_traits: public cc::lazy_list::type_traits + struct RCU_GPI_cmp_traits: public cc::lazy_list::traits { typedef HashSetHdrTest::cmp compare; }; - struct RCU_GPI_less_traits: public cc::lazy_list::type_traits + struct RCU_GPI_less_traits: public cc::lazy_list::traits { typedef HashSetHdrTest::less less; }; - struct RCU_GPI_cmpmix_traits: public cc::lazy_list::type_traits + struct RCU_GPI_cmpmix_traits: public cc::lazy_list::traits { typedef HashSetHdrTest::cmp compare; typedef HashSetHdrTest::less less; diff --git a/tests/test-hdr/set/hdr_michael_set_lazy_rcu_gpt.cpp b/tests/test-hdr/set/hdr_michael_set_lazy_rcu_gpt.cpp index 20841a42..b17a4659 100644 --- a/tests/test-hdr/set/hdr_michael_set_lazy_rcu_gpt.cpp +++ b/tests/test-hdr/set/hdr_michael_set_lazy_rcu_gpt.cpp @@ -10,23 +10,23 @@ namespace set { namespace { typedef cds::urcu::gc< cds::urcu::general_threaded<> > rcu_type; - struct set_traits: public cc::michael_set::type_traits + struct set_traits: public cc::michael_set::traits { typedef HashSetHdrTest::hash_int hash; typedef HashSetHdrTest::simple_item_counter item_counter; }; - struct RCU_GPT_cmp_traits: public cc::lazy_list::type_traits + struct RCU_GPT_cmp_traits: public cc::lazy_list::traits { typedef HashSetHdrTest::cmp compare; }; - struct RCU_GPT_less_traits: public cc::lazy_list::type_traits + struct RCU_GPT_less_traits: public cc::lazy_list::traits { typedef HashSetHdrTest::less less; }; - struct RCU_GPT_cmpmix_traits: public cc::lazy_list::type_traits + struct RCU_GPT_cmpmix_traits: public cc::lazy_list::traits { typedef HashSetHdrTest::cmp compare; typedef HashSetHdrTest::less less; diff --git a/tests/test-hdr/set/hdr_michael_set_lazy_rcu_shb.cpp b/tests/test-hdr/set/hdr_michael_set_lazy_rcu_shb.cpp index 823a332b..a6a55103 100644 --- a/tests/test-hdr/set/hdr_michael_set_lazy_rcu_shb.cpp +++ b/tests/test-hdr/set/hdr_michael_set_lazy_rcu_shb.cpp @@ -11,23 +11,23 @@ namespace set { namespace { typedef cds::urcu::gc< cds::urcu::signal_buffered<> > rcu_type; - struct set_traits: public cc::michael_set::type_traits + struct set_traits: public cc::michael_set::traits { typedef HashSetHdrTest::hash_int hash; typedef HashSetHdrTest::simple_item_counter item_counter; }; - struct RCU_SHB_cmp_traits: public cc::lazy_list::type_traits + struct RCU_SHB_cmp_traits: public cc::lazy_list::traits { typedef HashSetHdrTest::cmp compare; }; - struct RCU_SHB_less_traits: public cc::lazy_list::type_traits + struct RCU_SHB_less_traits: public cc::lazy_list::traits { typedef HashSetHdrTest::less less; }; - struct RCU_SHB_cmpmix_traits: public cc::lazy_list::type_traits + struct RCU_SHB_cmpmix_traits: public cc::lazy_list::traits { typedef HashSetHdrTest::cmp compare; typedef HashSetHdrTest::less less; diff --git a/tests/test-hdr/set/hdr_michael_set_lazy_rcu_sht.cpp b/tests/test-hdr/set/hdr_michael_set_lazy_rcu_sht.cpp index 13c7f594..343dd782 100644 --- a/tests/test-hdr/set/hdr_michael_set_lazy_rcu_sht.cpp +++ b/tests/test-hdr/set/hdr_michael_set_lazy_rcu_sht.cpp @@ -11,23 +11,23 @@ namespace set { namespace { typedef cds::urcu::gc< cds::urcu::signal_threaded<> > rcu_type; - struct set_traits: public cc::michael_set::type_traits + struct set_traits: public cc::michael_set::traits { typedef HashSetHdrTest::hash_int hash; typedef HashSetHdrTest::simple_item_counter item_counter; }; - struct RCU_SHT_cmp_traits: public cc::lazy_list::type_traits + struct RCU_SHT_cmp_traits: public cc::lazy_list::traits { typedef HashSetHdrTest::cmp compare; }; - struct RCU_SHT_less_traits: public cc::lazy_list::type_traits + struct RCU_SHT_less_traits: public cc::lazy_list::traits { typedef HashSetHdrTest::less less; }; - struct RCU_SHT_cmpmix_traits: public cc::lazy_list::type_traits + struct RCU_SHT_cmpmix_traits: public cc::lazy_list::traits { typedef HashSetHdrTest::cmp compare; typedef HashSetHdrTest::less less; diff --git a/tests/test-hdr/set/hdr_michael_set_nogc.cpp b/tests/test-hdr/set/hdr_michael_set_nogc.cpp index 032114dc..8160f4c2 100644 --- a/tests/test-hdr/set/hdr_michael_set_nogc.cpp +++ b/tests/test-hdr/set/hdr_michael_set_nogc.cpp @@ -7,23 +7,23 @@ namespace set { namespace { - struct set_traits: public cc::michael_set::type_traits + struct set_traits: public cc::michael_set::traits { typedef HashSetHdrTest::hash_int hash; typedef HashSetHdrTest::simple_item_counter item_counter; }; - struct nogc_cmp_traits: public cc::michael_list::type_traits + struct nogc_cmp_traits: public cc::michael_list::traits { typedef HashSetHdrTest::cmp compare; }; - struct nogc_less_traits: public cc::michael_list::type_traits + struct nogc_less_traits: public cc::michael_list::traits { typedef HashSetHdrTest::less less; }; - struct nogc_cmpmix_traits: public cc::michael_list::type_traits + struct nogc_cmpmix_traits: public cc::michael_list::traits { typedef HashSetHdrTest::cmp compare; typedef HashSetHdrTest::less less; diff --git a/tests/test-hdr/set/hdr_michael_set_ptb.cpp b/tests/test-hdr/set/hdr_michael_set_ptb.cpp deleted file mode 100644 index 0d4305e0..00000000 --- a/tests/test-hdr/set/hdr_michael_set_ptb.cpp +++ /dev/null @@ -1,88 +0,0 @@ -//$$CDS-header$$ - -#include "set/hdr_set.h" -#include -#include - -namespace set { - - namespace { - struct set_traits: public cc::michael_set::type_traits - { - typedef HashSetHdrTest::hash_int hash; - typedef HashSetHdrTest::simple_item_counter item_counter; - }; - - struct PTB_cmp_traits: public cc::michael_list::type_traits - { - typedef HashSetHdrTest::cmp compare; - }; - - struct PTB_less_traits: public cc::michael_list::type_traits - { - typedef HashSetHdrTest::less less; - }; - - struct PTB_cmpmix_traits: public cc::michael_list::type_traits - { - typedef HashSetHdrTest::cmp compare; - typedef HashSetHdrTest::less less; - }; - } - - void HashSetHdrTest::Michael_PTB_cmp() - { - typedef cc::MichaelList< cds::gc::PTB, item, PTB_cmp_traits > list; - - // traits-based version - typedef cc::MichaelHashSet< cds::gc::PTB, list, set_traits > set; - test_int< set >(); - - // option-based version - typedef cc::MichaelHashSet< cds::gc::PTB, list, - cc::michael_set::make_traits< - cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - >::type - > opt_set; - test_int< opt_set >(); - } - - void HashSetHdrTest::Michael_PTB_less() - { - typedef cc::MichaelList< cds::gc::PTB, item, PTB_less_traits > list; - - // traits-based version - typedef cc::MichaelHashSet< cds::gc::PTB, list, set_traits > set; - test_int< set >(); - - // option-based version - typedef cc::MichaelHashSet< cds::gc::PTB, list, - cc::michael_set::make_traits< - cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - >::type - > opt_set; - test_int< opt_set >(); - } - - void HashSetHdrTest::Michael_PTB_cmpmix() - { - typedef cc::MichaelList< cds::gc::PTB, item, PTB_cmpmix_traits > list; - - // traits-based version - typedef cc::MichaelHashSet< cds::gc::PTB, list, set_traits > set; - test_int< set >(); - - // option-based version - typedef cc::MichaelHashSet< cds::gc::PTB, list, - cc::michael_set::make_traits< - cc::opt::hash< hash_int > - ,cc::opt::item_counter< simple_item_counter > - >::type - > opt_set; - test_int< opt_set >(); - } - - -} // namespace set diff --git a/tests/test-hdr/set/hdr_michael_set_rcu_gpb.cpp b/tests/test-hdr/set/hdr_michael_set_rcu_gpb.cpp index 215abc85..21c28094 100644 --- a/tests/test-hdr/set/hdr_michael_set_rcu_gpb.cpp +++ b/tests/test-hdr/set/hdr_michael_set_rcu_gpb.cpp @@ -10,23 +10,23 @@ namespace set { namespace { typedef cds::urcu::gc< cds::urcu::general_buffered<> > rcu_type; - struct set_traits: public cc::michael_set::type_traits + struct set_traits: public cc::michael_set::traits { typedef HashSetHdrTest::hash_int hash; typedef HashSetHdrTest::simple_item_counter item_counter; }; - struct RCU_GPB_cmp_traits: public cc::michael_list::type_traits + struct RCU_GPB_cmp_traits: public cc::michael_list::traits { typedef HashSetHdrTest::cmp compare; }; - struct RCU_GPB_less_traits: public cc::michael_list::type_traits + struct RCU_GPB_less_traits: public cc::michael_list::traits { typedef HashSetHdrTest::less less; }; - struct RCU_GPB_cmpmix_traits: public cc::michael_list::type_traits + struct RCU_GPB_cmpmix_traits: public cc::michael_list::traits { typedef HashSetHdrTest::cmp compare; typedef HashSetHdrTest::less less; diff --git a/tests/test-hdr/set/hdr_michael_set_rcu_gpi.cpp b/tests/test-hdr/set/hdr_michael_set_rcu_gpi.cpp index 5d6ca35a..aed109b5 100644 --- a/tests/test-hdr/set/hdr_michael_set_rcu_gpi.cpp +++ b/tests/test-hdr/set/hdr_michael_set_rcu_gpi.cpp @@ -10,23 +10,23 @@ namespace set { namespace { typedef cds::urcu::gc< cds::urcu::general_instant<> > rcu_type; - struct set_traits: public cc::michael_set::type_traits + struct set_traits: public cc::michael_set::traits { typedef HashSetHdrTest::hash_int hash; typedef HashSetHdrTest::simple_item_counter item_counter; }; - struct RCU_GPI_cmp_traits: public cc::michael_list::type_traits + struct RCU_GPI_cmp_traits: public cc::michael_list::traits { typedef HashSetHdrTest::cmp compare; }; - struct RCU_GPI_less_traits: public cc::michael_list::type_traits + struct RCU_GPI_less_traits: public cc::michael_list::traits { typedef HashSetHdrTest::less less; }; - struct RCU_GPI_cmpmix_traits: public cc::michael_list::type_traits + struct RCU_GPI_cmpmix_traits: public cc::michael_list::traits { typedef HashSetHdrTest::cmp compare; typedef HashSetHdrTest::less less; diff --git a/tests/test-hdr/set/hdr_michael_set_rcu_gpt.cpp b/tests/test-hdr/set/hdr_michael_set_rcu_gpt.cpp index 056514bc..c75eed96 100644 --- a/tests/test-hdr/set/hdr_michael_set_rcu_gpt.cpp +++ b/tests/test-hdr/set/hdr_michael_set_rcu_gpt.cpp @@ -10,23 +10,23 @@ namespace set { namespace { typedef cds::urcu::gc< cds::urcu::general_threaded<> > rcu_type; - struct set_traits: public cc::michael_set::type_traits + struct set_traits: public cc::michael_set::traits { typedef HashSetHdrTest::hash_int hash; typedef HashSetHdrTest::simple_item_counter item_counter; }; - struct RCU_GPT_cmp_traits: public cc::michael_list::type_traits + struct RCU_GPT_cmp_traits: public cc::michael_list::traits { typedef HashSetHdrTest::cmp compare; }; - struct RCU_GPT_less_traits: public cc::michael_list::type_traits + struct RCU_GPT_less_traits: public cc::michael_list::traits { typedef HashSetHdrTest::less less; }; - struct RCU_GPT_cmpmix_traits: public cc::michael_list::type_traits + struct RCU_GPT_cmpmix_traits: public cc::michael_list::traits { typedef HashSetHdrTest::cmp compare; typedef HashSetHdrTest::less less; diff --git a/tests/test-hdr/set/hdr_michael_set_rcu_shb.cpp b/tests/test-hdr/set/hdr_michael_set_rcu_shb.cpp index d06cfeab..fe37af65 100644 --- a/tests/test-hdr/set/hdr_michael_set_rcu_shb.cpp +++ b/tests/test-hdr/set/hdr_michael_set_rcu_shb.cpp @@ -11,23 +11,23 @@ namespace set { namespace { typedef cds::urcu::gc< cds::urcu::signal_buffered<> > rcu_type; - struct set_traits: public cc::michael_set::type_traits + struct set_traits: public cc::michael_set::traits { typedef HashSetHdrTest::hash_int hash; typedef HashSetHdrTest::simple_item_counter item_counter; }; - struct RCU_SHB_cmp_traits: public cc::michael_list::type_traits + struct RCU_SHB_cmp_traits: public cc::michael_list::traits { typedef HashSetHdrTest::cmp compare; }; - struct RCU_SHB_less_traits: public cc::michael_list::type_traits + struct RCU_SHB_less_traits: public cc::michael_list::traits { typedef HashSetHdrTest::less less; }; - struct RCU_SHB_cmpmix_traits: public cc::michael_list::type_traits + struct RCU_SHB_cmpmix_traits: public cc::michael_list::traits { typedef HashSetHdrTest::cmp compare; typedef HashSetHdrTest::less less; diff --git a/tests/test-hdr/set/hdr_michael_set_rcu_sht.cpp b/tests/test-hdr/set/hdr_michael_set_rcu_sht.cpp index 81534a96..0122333f 100644 --- a/tests/test-hdr/set/hdr_michael_set_rcu_sht.cpp +++ b/tests/test-hdr/set/hdr_michael_set_rcu_sht.cpp @@ -11,23 +11,23 @@ namespace set { namespace { typedef cds::urcu::gc< cds::urcu::signal_threaded<> > rcu_type; - struct set_traits: public cc::michael_set::type_traits + struct set_traits: public cc::michael_set::traits { typedef HashSetHdrTest::hash_int hash; typedef HashSetHdrTest::simple_item_counter item_counter; }; - struct RCU_SHT_cmp_traits: public cc::michael_list::type_traits + struct RCU_SHT_cmp_traits: public cc::michael_list::traits { typedef HashSetHdrTest::cmp compare; }; - struct RCU_SHT_less_traits: public cc::michael_list::type_traits + struct RCU_SHT_less_traits: public cc::michael_list::traits { typedef HashSetHdrTest::less less; }; - struct RCU_SHT_cmpmix_traits: public cc::michael_list::type_traits + struct RCU_SHT_cmpmix_traits: public cc::michael_list::traits { typedef HashSetHdrTest::cmp compare; typedef HashSetHdrTest::less less; diff --git a/tests/test-hdr/set/hdr_set.h b/tests/test-hdr/set/hdr_set.h index cb6cf43b..14792f32 100644 --- a/tests/test-hdr/set/hdr_set.h +++ b/tests/test-hdr/set/hdr_set.h @@ -825,9 +825,9 @@ namespace set { void Michael_HP_less(); void Michael_HP_cmpmix(); - void Michael_PTB_cmp(); - void Michael_PTB_less(); - void Michael_PTB_cmpmix(); + void Michael_DHP_cmp(); + void Michael_DHP_less(); + void Michael_DHP_cmpmix(); void Michael_RCU_GPI_cmp(); void Michael_RCU_GPI_less(); @@ -857,9 +857,9 @@ namespace set { void Lazy_HP_less(); void Lazy_HP_cmpmix(); - void Lazy_PTB_cmp(); - void Lazy_PTB_less(); - void Lazy_PTB_cmpmix(); + void Lazy_DHP_cmp(); + void Lazy_DHP_less(); + void Lazy_DHP_cmpmix(); void Lazy_RCU_GPI_cmp(); void Lazy_RCU_GPI_less(); @@ -955,9 +955,9 @@ namespace set { CPPUNIT_TEST(Michael_HP_less) CPPUNIT_TEST(Michael_HP_cmpmix) - CPPUNIT_TEST(Michael_PTB_cmp) - CPPUNIT_TEST(Michael_PTB_less) - CPPUNIT_TEST(Michael_PTB_cmpmix) + CPPUNIT_TEST(Michael_DHP_cmp) + CPPUNIT_TEST(Michael_DHP_less) + CPPUNIT_TEST(Michael_DHP_cmpmix) CPPUNIT_TEST(Michael_RCU_GPI_cmp) CPPUNIT_TEST(Michael_RCU_GPI_less) @@ -987,9 +987,9 @@ namespace set { CPPUNIT_TEST(Lazy_HP_less) CPPUNIT_TEST(Lazy_HP_cmpmix) - CPPUNIT_TEST(Lazy_PTB_cmp) - CPPUNIT_TEST(Lazy_PTB_less) - CPPUNIT_TEST(Lazy_PTB_cmpmix) + CPPUNIT_TEST(Lazy_DHP_cmp) + CPPUNIT_TEST(Lazy_DHP_less) + CPPUNIT_TEST(Lazy_DHP_cmpmix) CPPUNIT_TEST(Lazy_RCU_GPI_cmp) CPPUNIT_TEST(Lazy_RCU_GPI_less)