Renamed get_result typedef to raw_ptr
[libcds.git] / cds / container / michael_set_rcu.h
1 //$$CDS-header$$
2
3 #ifndef CDSLIB_CONTAINER_MICHAEL_SET_RCU_H
4 #define CDSLIB_CONTAINER_MICHAEL_SET_RCU_H
5
6 #include <cds/container/details/michael_set_base.h>
7 #include <cds/details/allocator.h>
8
9 namespace cds { namespace container {
10
11     /// Michael's hash set (template specialization for \ref cds_urcu_desc "RCU")
12     /** @ingroup cds_nonintrusive_set
13         \anchor cds_nonintrusive_MichaelHashSet_rcu
14
15         Source:
16             - [2002] Maged Michael "High performance dynamic lock-free hash tables and list-based sets"
17
18         Michael's hash table algorithm is based on lock-free ordered list and it is very simple.
19         The main structure is an array \p T of size \p M. Each element in \p T is basically a pointer
20         to a hash bucket, implemented as a singly linked list. The array of buckets cannot be dynamically expanded.
21         However, each bucket may contain unbounded number of items.
22
23         Template parameters are:
24         - \p RCU - one of \ref cds_urcu_gc "RCU type"
25         - \p OrderedList - ordered list implementation used as the bucket for hash set, for example,
26             \ref cds_nonintrusive_MichaelList_rcu "MichaelList".
27             The ordered list implementation specifies the type \p T stored in the hash-set,
28             the comparison functor for the type \p T and other features specific for
29             the ordered list.
30         - \p Traits - set traits, default is michael_set::traits.
31             Instead of defining \p Traits struct you may use option-based syntax with michael_set::make_traits metafunction.
32
33         About hash functor see \ref cds_nonintrusive_MichaelHashSet_hash_functor "MichaelSet hash functor".
34
35         <b>How to use</b>
36
37         Suppose, we have the following type \p Foo that we want to store in your \p %MichaelHashSet:
38         \code
39         struct Foo {
40             int     nKey    ;   // key field
41             int     nVal    ;   // value field
42         };
43         \endcode
44
45         To use \p %MichaelHashSet for \p Foo values, you should first choose suitable ordered list class
46         that will be used as a bucket for the set. We will cds::urcu::general_buffered<> RCU type and
47         MichaelList as a bucket type.
48         You should include RCU-related header file (<tt>cds/urcu/general_buffered.h</tt> in this example)
49         before including <tt>cds/container/michael_set_rcu.h</tt>.
50         Also, for ordered list we should develop a comparator for our \p Foo struct.
51         \code
52         #include <cds/urcu/general_buffered.h>
53         #include <cds/container/michael_list_rcu.h>
54         #include <cds/container/michael_set_rcu.h>
55
56         namespace cc = cds::container;
57
58         // Foo comparator
59         struct Foo_cmp {
60             int operator ()(Foo const& v1, Foo const& v2 ) const
61             {
62                 if ( std::less( v1.nKey, v2.nKey ))
63                     return -1;
64                 return std::less(v2.nKey, v1.nKey) ? 1 : 0;
65             }
66         };
67
68         // Ordered list
69         typedef cc::MichaelList< cds::urcu::gc< cds::urcu::general_buffered<> >, Foo,
70             typename cc::michael_list::make_traits<
71                 cc::opt::compare< Foo_cmp >     // item comparator option
72             >::type
73         > bucket_list;
74
75         // Hash functor for Foo
76         struct foo_hash {
77             size_t operator ()( int i ) const
78             {
79                 return std::hash( i );
80             }
81             size_t operator()( Foo const& i ) const
82             {
83                 return std::hash( i.nKey );
84             }
85         };
86
87         // Declare the set
88         // Note that \p RCU template parameter of ordered list must be equal \p RCU for the set.
89         typedef cc::MichaelHashSet< cds::urcu::gc< cds::urcu::general_buffered<> >, bucket_list,
90             cc::michael_set::make_traits<
91                 cc::opt::hash< foo_hash >
92             >::type
93         > foo_set;
94
95         foo_set fooSet;
96         \endcode
97     */
98     template <
99         class RCU,
100         class OrderedList,
101 #ifdef CDS_DOXYGEN_INVOKED
102         class Traits = michael_set::traits
103 #else
104         class Traits
105 #endif
106     >
107     class MichaelHashSet< cds::urcu::gc< RCU >, OrderedList, Traits >
108     {
109     public:
110         typedef cds::urcu::gc< RCU > gc; ///< RCU used as garbage collector
111         typedef OrderedList bucket_type; ///< type of ordered list to be used as a bucket implementation
112         typedef Traits      traits;      ///< Set traits
113
114         typedef typename bucket_type::value_type        value_type;     ///< type of value to be stored in the list
115         typedef typename bucket_type::key_comparator    key_comparator; ///< key comparing functor
116
117         /// Hash functor for \ref value_type and all its derivatives that you use
118         typedef typename cds::opt::v::hash_selector< typename traits::hash >::type hash;
119         typedef typename traits::item_counter item_counter;   ///< Item counter type
120
121         /// Bucket table allocator
122         typedef cds::details::Allocator< bucket_type, typename traits::allocator >  bucket_table_allocator;
123
124         typedef typename bucket_type::rcu_lock   rcu_lock;   ///< RCU scoped lock
125         typedef typename bucket_type::exempt_ptr exempt_ptr; ///< pointer to extracted node
126         typedef typename bucket_type::raw_ptr    raw_ptr;    ///< Return type of \p get() member function and its derivatives
127         /// Group of \p extract_xxx functions require external locking if underlying ordered list requires that
128         static CDS_CONSTEXPR const bool c_bExtractLockExternal = bucket_type::c_bExtractLockExternal;
129
130         //@cond
131         typedef cds::container::michael_set::implementation_tag implementation_tag;
132         //@endcond
133
134     protected:
135         item_counter    m_ItemCounter; ///< Item counter
136         hash            m_HashFunctor; ///< Hash functor
137         bucket_type *   m_Buckets;     ///< bucket table
138
139     private:
140         //@cond
141         const size_t    m_nHashBitmask;
142         //@endcond
143
144     protected:
145         //@cond
146         /// Calculates hash value of \p key
147         template <typename Q>
148         size_t hash_value( Q const& key ) const
149         {
150             return m_HashFunctor( key ) & m_nHashBitmask;
151         }
152
153         /// Returns the bucket (ordered list) for \p key
154         template <typename Q>
155         bucket_type&    bucket( Q const& key )
156         {
157             return m_Buckets[ hash_value( key ) ];
158         }
159         template <typename Q>
160         bucket_type const&    bucket( Q const& key ) const
161         {
162             return m_Buckets[ hash_value( key ) ];
163         }
164         //@endcond
165     public:
166         /// Forward iterator
167         /**
168             The forward iterator for Michael's set is based on \p OrderedList forward iterator and has some features:
169             - it has no post-increment operator
170             - it iterates items in unordered fashion
171             - The iterator cannot be moved across thread boundary since it may contain GC's guard that is thread-private GC data.
172             - Iterator ensures thread-safety even if you delete the item that iterator points to. However, in case of concurrent
173               deleting operations it is no guarantee that you iterate all item in the set.
174
175             Therefore, the use of iterators in concurrent environment is not good idea. Use the iterator for the concurrent container
176             for debug purpose only.
177         */
178         typedef michael_set::details::iterator< bucket_type, false >    iterator;
179
180         /// Const forward iterator
181         typedef michael_set::details::iterator< bucket_type, true >     const_iterator;
182
183         /// Returns a forward iterator addressing the first element in a set
184         /**
185             For empty set \code begin() == end() \endcode
186         */
187         iterator begin()
188         {
189             return iterator( m_Buckets[0].begin(), m_Buckets, m_Buckets + bucket_count() );
190         }
191
192         /// Returns an iterator that addresses the location succeeding the last element in a set
193         /**
194             Do not use the value returned by <tt>end</tt> function to access any item.
195             The returned value can be used only to control reaching the end of the set.
196             For empty set \code begin() == end() \endcode
197         */
198         iterator end()
199         {
200             return iterator( m_Buckets[bucket_count() - 1].end(), m_Buckets + bucket_count() - 1, m_Buckets + bucket_count() );
201         }
202
203         /// Returns a forward const iterator addressing the first element in a set
204         //@{
205         const_iterator begin() const
206         {
207             return get_const_begin();
208         }
209         const_iterator cbegin() const
210         {
211             return get_const_begin();
212         }
213         //@}
214
215         /// Returns an const iterator that addresses the location succeeding the last element in a set
216         //@{
217         const_iterator end() const
218         {
219             return get_const_end();
220         }
221         const_iterator cend() const
222         {
223             return get_const_end();
224         }
225         //@}
226
227     private:
228         //@cond
229         const_iterator get_const_begin() const
230         {
231             return const_iterator( const_cast<bucket_type const&>(m_Buckets[0]).begin(), m_Buckets, m_Buckets + bucket_count() );
232         }
233         const_iterator get_const_end() const
234         {
235             return const_iterator( const_cast<bucket_type const&>(m_Buckets[bucket_count() - 1]).end(), m_Buckets + bucket_count() - 1, m_Buckets + bucket_count() );
236         }
237         //@endcond
238
239     public:
240         /// Initialize hash set
241         /** @copydetails cds_nonintrusive_MichaelHashSet_hp_ctor
242         */
243         MichaelHashSet(
244             size_t nMaxItemCount,   ///< estimation of max item count in the hash set
245             size_t nLoadFactor      ///< load factor: estimation of max number of items in the bucket
246         ) : m_nHashBitmask( michael_set::details::init_hash_bitmask( nMaxItemCount, nLoadFactor ))
247         {
248             // GC and OrderedList::gc must be the same
249             static_assert( std::is_same<gc, typename bucket_type::gc>::value, "GC and OrderedList::gc must be the same");
250
251             // atomicity::empty_item_counter is not allowed as a item counter
252             static_assert( !std::is_same<item_counter, atomicity::empty_item_counter>::value,
253                            "atomicity::empty_item_counter is not allowed as a item counter");
254
255             m_Buckets = bucket_table_allocator().NewArray( bucket_count() );
256         }
257
258         /// Clears hash set and destroys it
259         ~MichaelHashSet()
260         {
261             clear();
262             bucket_table_allocator().Delete( m_Buckets, bucket_count() );
263         }
264
265         /// Inserts new node
266         /**
267             The function creates a node with copy of \p val value
268             and then inserts the node created into the set.
269
270             The type \p Q should contain as minimum the complete key for the node.
271             The object of \ref value_type should be constructible from a value of type \p Q.
272             In trivial case, \p Q is equal to \ref value_type.
273
274             The function applies RCU lock internally.
275
276             Returns \p true if \p val is inserted into the set, \p false otherwise.
277         */
278         template <typename Q>
279         bool insert( Q const& val )
280         {
281             const bool bRet = bucket( val ).insert( val );
282             if ( bRet )
283                 ++m_ItemCounter;
284             return bRet;
285         }
286
287         /// Inserts new node
288         /**
289             The function allows to split creating of new item into two part:
290             - create item with key only
291             - insert new item into the set
292             - if inserting is success, calls  \p f functor to initialize value-fields of \p val.
293
294             The functor signature is:
295             \code
296                 void func( value_type& val );
297             \endcode
298             where \p val is the item inserted.
299             The user-defined functor is called only if the inserting is success.
300
301             The function applies RCU lock internally.
302
303             @warning For \ref cds_nonintrusive_MichaelList_rcu "MichaelList" as the bucket see \ref cds_intrusive_item_creating "insert item troubleshooting".
304             \ref cds_nonintrusive_LazyList_rcu "LazyList" provides exclusive access to inserted item and does not require any node-level
305             synchronization.
306             */
307         template <typename Q, typename Func>
308         bool insert( Q const& val, Func f )
309         {
310             const bool bRet = bucket( val ).insert( val, f );
311             if ( bRet )
312                 ++m_ItemCounter;
313             return bRet;
314         }
315
316         /// Ensures that the item exists in the set
317         /**
318             The operation performs inserting or changing data with lock-free manner.
319
320             If the \p val key not found in the set, then the new item created from \p val
321             is inserted into the set. Otherwise, the functor \p func is called with the item found.
322             The functor \p Func signature is:
323             \code
324                 struct my_functor {
325                     void operator()( bool bNew, value_type& item, const Q& val );
326                 };
327             \endcode
328
329             with arguments:
330             - \p bNew - \p true if the item has been inserted, \p false otherwise
331             - \p item - item of the set
332             - \p val - argument \p key passed into the \p ensure function
333
334             The functor may change non-key fields of the \p item.
335
336             The function applies RCU lock internally.
337
338             Returns <tt> std::pair<bool, bool> </tt> where \p first is true if operation is successfull,
339             \p second is true if new item has been added or \p false if the item with \p key
340             already is in the set.
341
342             @warning For \ref cds_nonintrusive_MichaelList_rcu "MichaelList" as the bucket see \ref cds_intrusive_item_creating "insert item troubleshooting".
343             \ref cds_nonintrusive_LazyList_rcu "LazyList" provides exclusive access to inserted item and does not require any node-level
344             synchronization.
345         */
346         template <typename Q, typename Func>
347         std::pair<bool, bool> ensure( const Q& val, Func func )
348         {
349             std::pair<bool, bool> bRet = bucket( val ).ensure( val, func );
350             if ( bRet.first && bRet.second )
351                 ++m_ItemCounter;
352             return bRet;
353         }
354
355         /// Inserts data of type \p value_type created from \p args
356         /**
357             Returns \p true if inserting successful, \p false otherwise.
358
359             The function applies RCU lock internally.
360         */
361         template <typename... Args>
362         bool emplace( Args&&... args )
363         {
364             bool bRet = bucket( value_type(std::forward<Args>(args)...) ).emplace( std::forward<Args>(args)... );
365             if ( bRet )
366                 ++m_ItemCounter;
367             return bRet;
368         }
369
370         /// Deletes \p key from the set
371         /** \anchor cds_nonintrusive_MichealSet_rcu_erase_val
372
373             Since the key of MichaelHashSet's item type \p value_type is not explicitly specified,
374             template parameter \p Q defines the key type searching in the list.
375             The set item comparator should be able to compare the type \p value_type
376             and the type \p Q.
377
378             RCU \p synchronize method can be called. RCU should not be locked.
379
380             Return \p true if key is found and deleted, \p false otherwise
381         */
382         template <typename Q>
383         bool erase( Q const& key )
384         {
385             const bool bRet = bucket( key ).erase( key );
386             if ( bRet )
387                 --m_ItemCounter;
388             return bRet;
389         }
390
391         /// Deletes the item from the set using \p pred predicate for searching
392         /**
393             The function is an analog of \ref cds_nonintrusive_MichealSet_rcu_erase_val "erase(Q const&)"
394             but \p pred is used for key comparing.
395             \p Less functor has the interface like \p std::less.
396             \p Less must imply the same element order as the comparator used for building the set.
397         */
398         template <typename Q, typename Less>
399         bool erase_with( Q const& key, Less pred )
400         {
401             const bool bRet = bucket( key ).erase_with( key, pred );
402             if ( bRet )
403                 --m_ItemCounter;
404             return bRet;
405         }
406
407         /// Deletes \p key from the set
408         /** \anchor cds_nonintrusive_MichealSet_rcu_erase_func
409
410             The function searches an item with key \p key, calls \p f functor
411             and deletes the item. If \p key is not found, the functor is not called.
412
413             The functor \p Func interface:
414             \code
415             struct extractor {
416                 void operator()(value_type const& val);
417             };
418             \endcode
419
420             Since the key of %MichaelHashSet's \p value_type is not explicitly specified,
421             template parameter \p Q defines the key type searching in the list.
422             The list item comparator should be able to compare the type \p T of list item
423             and the type \p Q.
424
425             RCU \p synchronize method can be called. RCU should not be locked.
426
427             Return \p true if key is found and deleted, \p false otherwise
428         */
429         template <typename Q, typename Func>
430         bool erase( Q const& key, Func f )
431         {
432             const bool bRet = bucket( key ).erase( key, f );
433             if ( bRet )
434                 --m_ItemCounter;
435             return bRet;
436         }
437
438         /// Deletes the item from the set using \p pred predicate for searching
439         /**
440             The function is an analog of \ref cds_nonintrusive_MichealSet_rcu_erase_func "erase(Q const&, Func)"
441             but \p pred is used for key comparing.
442             \p Less functor has the interface like \p std::less.
443             \p Less must imply the same element order as the comparator used for building the set.
444         */
445         template <typename Q, typename Less, typename Func>
446         bool erase_with( Q const& key, Less pred, Func f )
447         {
448             const bool bRet = bucket( key ).erase_with( key, pred, f );
449             if ( bRet )
450                 --m_ItemCounter;
451             return bRet;
452         }
453
454         /// Extracts an item from the set
455         /** \anchor cds_nonintrusive_MichaelHashSet_rcu_extract
456             The function searches an item with key equal to \p key in the set,
457             unlinks it from the set, and returns \ref cds::urcu::exempt_ptr "exempt_ptr" pointer to the item found.
458             If the item with the key equal to \p key is not found the function return an empty \p exempt_ptr.
459
460             The function just excludes the item from the set and returns a pointer to item found.
461             Depends on \p bucket_type you should or should not lock RCU before calling of this function:
462             - for the set based on \ref cds_nonintrusive_MichaelList_rcu "MichaelList" RCU should not be locked
463             - for the set based on \ref cds_nonintrusive_LazyList_rcu "LazyList" RCU should be locked
464             See ordered list implementation for details.
465
466             \code
467             #include <cds/urcu/general_buffered.h>
468             #include <cds/container/michael_list_rcu.h>
469             #include <cds/container/michael_set_rcu.h>
470
471             typedef cds::urcu::gc< general_buffered<> > rcu;
472             typedef cds::container::MichaelList< rcu, Foo > rcu_michael_list;
473             typedef cds::container::MichaelHashSet< rcu, rcu_michael_list, foo_traits > rcu_michael_set;
474
475             rcu_michael_set theSet;
476             // ...
477
478             typename rcu_michael_set::exempt_ptr p;
479
480             // For MichaelList we should not lock RCU
481
482             // Note that you must not delete the item found inside the RCU lock
483             p = theSet.extract( 10 );
484             if ( p ) {
485                 // do something with p
486                 ...
487             }
488
489             // We may safely release p here
490             // release() passes the pointer to RCU reclamation cycle
491             p.release();
492             \endcode
493         */
494         template <typename Q>
495         exempt_ptr extract( Q const& key )
496         {
497             exempt_ptr p = bucket( key ).extract( key );
498             if ( p )
499                 --m_ItemCounter;
500             return p;
501         }
502
503         /// Extracts an item from the set using \p pred predicate for searching
504         /**
505             The function is an analog of \p extract(Q const&) but \p pred is used for key comparing.
506             \p Less functor has the interface like \p std::less.
507             \p pred must imply the same element order as the comparator used for building the set.
508         */
509         template <typename Q, typename Less>
510         exempt_ptr extract_with( Q const& key, Less pred )
511         {
512             exempt_ptr p = bucket( key ).extract_with( key, pred );
513             if ( p )
514                 --m_ItemCounter;
515             return p;
516         }
517
518         /// Finds the key \p key
519         /** \anchor cds_nonintrusive_MichealSet_rcu_find_func
520
521             The function searches the item with key equal to \p key and calls the functor \p f for item found.
522             The interface of \p Func functor is:
523             \code
524             struct functor {
525                 void operator()( value_type& item, Q& key );
526             };
527             \endcode
528             where \p item is the item found, \p key is the <tt>find</tt> function argument.
529
530             The functor may change non-key fields of \p item. Note that the functor is only guarantee
531             that \p item cannot be disposed during functor is executing.
532             The functor does not serialize simultaneous access to the set's \p item. If such access is
533             possible you must provide your own synchronization schema on item level to exclude unsafe item modifications.
534
535             The \p key argument is non-const since it can be used as \p f functor destination i.e., the functor
536             can modify both arguments.
537
538             Note the hash functor specified for class \p Traits template parameter
539             should accept a parameter of type \p Q that may be not the same as \p value_type.
540
541             The function applies RCU lock internally.
542
543             The function returns \p true if \p key is found, \p false otherwise.
544         */
545         template <typename Q, typename Func>
546         bool find( Q& key, Func f )
547         {
548             return bucket( key ).find( key, f );
549         }
550         //@cond
551         template <typename Q, typename Func>
552         bool find( Q const& key, Func f )
553         {
554             return bucket( key ).find( key, f );
555         }
556         //@endcond
557
558         /// Finds the key \p key using \p pred predicate for searching
559         /**
560             The function is an analog of \ref cds_nonintrusive_MichealSet_rcu_find_func "find(Q&, Func)"
561             but \p pred is used for key comparing.
562             \p Less functor has the interface like \p std::less.
563             \p Less must imply the same element order as the comparator used for building the set.
564         */
565         template <typename Q, typename Less, typename Func>
566         bool find_with( Q& key, Less pred, Func f )
567         {
568             return bucket( key ).find_with( key, pred, f );
569         }
570         //@cond
571         template <typename Q, typename Less, typename Func>
572         bool find_with( Q const& key, Less pred, Func f )
573         {
574             return bucket( key ).find_with( key, pred, f );
575         }
576         //@endcond
577
578         /// Finds the key \p key
579         /** \anchor cds_nonintrusive_MichealSet_rcu_find_val
580
581             The function searches the item with key equal to \p key
582             and returns \p true if it is found, and \p false otherwise.
583
584             Note the hash functor specified for class \p Traits template parameter
585             should accept a parameter of type \p Q that may be not the same as \p value_type.
586         */
587         template <typename Q>
588         bool find( Q const & key )
589         {
590             return bucket( key ).find( key );
591         }
592
593         /// Finds the key \p key using \p pred predicate for searching
594         /**
595             The function is an analog of \ref cds_nonintrusive_MichealSet_rcu_find_val "find(Q const&)"
596             but \p pred is used for key comparing.
597             \p Less functor has the interface like \p std::less.
598             \p Less must imply the same element order as the comparator used for building the set.
599         */
600         template <typename Q, typename Less>
601         bool find_with( Q const & key, Less pred )
602         {
603             return bucket( key ).find_with( key, pred );
604         }
605
606         /// Finds the key \p key and return the item found
607         /** \anchor cds_nonintrusive_MichaelHashSet_rcu_get
608             The function searches the item with key equal to \p key and returns the pointer to item found.
609             If \p key is not found it returns \p nullptr.
610             Note the type of returned value depends on underlying \p bucket_type.
611             For details, see documentation of ordered list you use.
612
613             Note the compare functor should accept a parameter of type \p Q that can be not the same as \p value_type.
614
615             RCU should be locked before call of this function.
616             Returned item is valid only while RCU is locked:
617             \code
618             typedef cds::container::MichaelHashSet< your_template_parameters > hash_set;
619             hash_set theSet;
620             typename hash_set::raw_ptr gp;
621             // ...
622             {
623                 // Lock RCU
624                 hash_set::rcu_lock lock;
625
626                 gp = theSet.get( 5 );
627                 if ( gp ) {
628                     // Deal with pVal
629                     //...
630                 }
631                 // Unlock RCU by rcu_lock destructor
632                 // gp can be reclaimed at any time after RCU has been unlocked
633             }
634             \endcode
635         */
636         template <typename Q>
637         raw_ptr get( Q const& key )
638         {
639             return bucket( key ).get( key );
640         }
641
642         /// Finds the key \p key and return the item found
643         /**
644             The function is an analog of \ref cds_nonintrusive_MichaelHashSet_rcu_get "get(Q const&)"
645             but \p pred is used for comparing the keys.
646
647             \p Less functor has the semantics like \p std::less but should take arguments of type \ref value_type and \p Q
648             in any order.
649             \p pred must imply the same element order as the comparator used for building the set.
650         */
651         template <typename Q, typename Less>
652         raw_ptr get_with( Q const& key, Less pred )
653         {
654             return bucket( key ).get_with( key, pred );
655         }
656
657         /// Clears the set (not atomic)
658         void clear()
659         {
660             for ( size_t i = 0; i < bucket_count(); ++i )
661                 m_Buckets[i].clear();
662             m_ItemCounter.reset();
663         }
664
665         /// Checks if the set is empty
666         /**
667             Emptiness is checked by item counting: if item count is zero then the set is empty.
668             Thus, the correct item counting feature is an important part of Michael's set implementation.
669         */
670         bool empty() const
671         {
672             return size() == 0;
673         }
674
675         /// Returns item count in the set
676         size_t size() const
677         {
678             return m_ItemCounter;
679         }
680
681         /// Returns the size of hash table
682         /**
683             Since \p %MichaelHashSet cannot dynamically extend the hash table size,
684             the value returned is an constant depending on object initialization parameters;
685             see MichaelHashSet::MichaelHashSet for explanation.
686         */
687         size_t bucket_count() const
688         {
689             return m_nHashBitmask + 1;
690         }
691     };
692
693 }} // namespace cds::container
694
695 #endif // ifndef CDSLIB_CONTAINER_MICHAEL_SET_RCU_H