2 This file is a part of libcds - Concurrent Data Structures library
4 (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
6 Source code repo: http://github.com/khizmax/libcds/
7 Download: http://sourceforge.net/projects/libcds/files/
9 Redistribution and use in source and binary forms, with or without
10 modification, are permitted provided that the following conditions are met:
12 * Redistributions of source code must retain the above copyright notice, this
13 list of conditions and the following disclaimer.
15 * Redistributions in binary form must reproduce the above copyright notice,
16 this list of conditions and the following disclaimer in the documentation
17 and/or other materials provided with the distribution.
19 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 #include "set/hdr_intrusive_set.h"
32 #include <cds/urcu/general_instant.h>
33 #include <cds/intrusive/lazy_list_rcu.h>
34 #include <cds/intrusive/michael_set_rcu.h>
38 typedef cds::urcu::gc< cds::urcu::general_instant<> > RCU;
41 void IntrusiveHashSetHdrTest::RCU_GPI_base_cmp_lazy()
43 typedef base_int_item< ci::lazy_list::node<RCU> > item;
45 public ci::lazy_list::make_traits<
46 ci::opt::hook< ci::lazy_list::base_hook< co::gc<RCU> > >
47 ,co::compare< cmp<item> >
48 ,ci::opt::disposer< faked_disposer >
49 ,ci::opt::back_off< cds::backoff::pause >
53 typedef ci::LazyList< RCU, item, list_traits > bucket_type;
55 struct set_traits : public ci::michael_set::traits
57 typedef hash_int hash;
59 typedef ci::MichaelHashSet< RCU, bucket_type, set_traits > set;
64 void IntrusiveHashSetHdrTest::RCU_GPI_base_less_lazy()
66 typedef base_int_item< ci::lazy_list::node<RCU> > item;
67 typedef ci::LazyList< RCU
69 ,ci::lazy_list::make_traits<
70 ci::opt::hook< ci::lazy_list::base_hook< co::gc<RCU> > >
71 ,co::less< less<item> >
72 ,ci::opt::disposer< faked_disposer >
76 typedef ci::MichaelHashSet< RCU, bucket_type,
77 ci::michael_set::make_traits<
85 void IntrusiveHashSetHdrTest::RCU_GPI_base_cmpmix_lazy()
87 typedef base_int_item< ci::lazy_list::node<RCU> > item;
88 typedef ci::LazyList< RCU
90 ,ci::lazy_list::make_traits<
91 ci::opt::hook< ci::lazy_list::base_hook< co::gc<RCU> > >
92 ,co::less< less<item> >
93 ,co::compare< cmp<item> >
94 ,ci::opt::disposer< faked_disposer >
98 typedef ci::MichaelHashSet< RCU, bucket_type,
99 ci::michael_set::make_traits<
101 ,co::item_counter< simple_item_counter >
108 void IntrusiveHashSetHdrTest::RCU_GPI_member_cmp_lazy()
110 typedef member_int_item< ci::lazy_list::node<RCU> > item;
111 typedef ci::LazyList< RCU
113 ,ci::lazy_list::make_traits<
114 ci::opt::hook< ci::lazy_list::member_hook<
115 offsetof( item, hMember ),
118 ,co::compare< cmp<item> >
119 ,ci::opt::disposer< faked_disposer >
123 typedef ci::MichaelHashSet< RCU, bucket_type,
124 ci::michael_set::make_traits<
132 void IntrusiveHashSetHdrTest::RCU_GPI_member_less_lazy()
134 typedef member_int_item< ci::lazy_list::node<RCU> > item;
135 typedef ci::LazyList< RCU
137 ,ci::lazy_list::make_traits<
138 ci::opt::hook< ci::lazy_list::member_hook<
139 offsetof( item, hMember ),
142 ,co::less< less<item> >
143 ,ci::opt::disposer< faked_disposer >
147 typedef ci::MichaelHashSet< RCU, bucket_type,
148 ci::michael_set::make_traits<
156 void IntrusiveHashSetHdrTest::RCU_GPI_member_cmpmix_lazy()
158 typedef member_int_item< ci::lazy_list::node<RCU> > item;
159 typedef ci::LazyList< RCU
161 ,ci::lazy_list::make_traits<
162 ci::opt::hook< ci::lazy_list::member_hook<
163 offsetof( item, hMember ),
166 ,co::compare< cmp<item> >
167 ,co::less< less<item> >
168 ,ci::opt::disposer< faked_disposer >
172 typedef ci::MichaelHashSet< RCU, bucket_type,
173 ci::michael_set::make_traits<
175 ,co::item_counter< simple_item_counter >