3 #include "set/hdr_intrusive_set.h"
4 #include <cds/urcu/general_instant.h>
5 #include <cds/intrusive/michael_list_rcu.h>
6 #include <cds/intrusive/split_list_rcu.h>
10 typedef cds::urcu::gc< cds::urcu::general_instant<> > rcu_type;
13 void IntrusiveHashSetHdrTest::split_dyn_RCU_GPI_base_cmp()
15 typedef base_int_item< ci::split_list::node< ci::michael_list::node<rcu_type> > > item;
16 typedef ci::MichaelList< rcu_type
18 ,ci::michael_list::make_traits<
19 ci::opt::hook< ci::michael_list::base_hook< co::gc<rcu_type> > >
20 ,co::compare< cmp<item> >
21 ,ci::opt::disposer< faked_disposer >
25 typedef ci::SplitListSet< rcu_type, ord_list,
26 ci::split_list::make_traits<
28 ,ci::split_list::dynamic_bucket_table<true>
29 ,co::memory_model<co::v::relaxed_ordering>
32 static_assert( set::traits::dynamic_bucket_table, "Set has static bucket table" );
37 void IntrusiveHashSetHdrTest::split_dyn_RCU_GPI_base_less()
39 typedef base_int_item< ci::split_list::node< ci::michael_list::node<rcu_type> > > item;
40 typedef ci::MichaelList< rcu_type
42 ,ci::michael_list::make_traits<
43 ci::opt::hook< ci::michael_list::base_hook< co::gc<rcu_type> > >
44 ,co::less< less<item> >
45 ,ci::opt::disposer< faked_disposer >
49 typedef ci::SplitListSet< rcu_type, ord_list,
50 ci::split_list::make_traits<
52 ,co::memory_model<co::v::sequential_consistent>
55 static_assert( set::traits::dynamic_bucket_table, "Set has static bucket table" );
60 void IntrusiveHashSetHdrTest::split_dyn_RCU_GPI_base_cmpmix()
62 typedef base_int_item< ci::split_list::node<ci::michael_list::node<rcu_type> > > item;
63 typedef ci::MichaelList< rcu_type
65 ,ci::michael_list::make_traits<
66 ci::opt::hook< ci::michael_list::base_hook< co::gc<rcu_type> > >
67 ,co::less< less<item> >
68 ,co::compare< cmp<item> >
69 ,ci::opt::disposer< faked_disposer >
73 typedef ci::SplitListSet< rcu_type, ord_list,
74 ci::split_list::make_traits<
76 ,co::item_counter< simple_item_counter >
77 ,ci::split_list::dynamic_bucket_table<true>
80 static_assert( set::traits::dynamic_bucket_table, "Set has static bucket table" );
85 void IntrusiveHashSetHdrTest::split_dyn_RCU_GPI_member_cmp()
87 typedef member_int_item< ci::split_list::node< ci::michael_list::node<rcu_type> > > item;
88 typedef ci::MichaelList< rcu_type
90 ,ci::michael_list::make_traits<
91 ci::opt::hook< ci::michael_list::member_hook<
92 offsetof( item, hMember ),
95 ,co::compare< cmp<item> >
96 ,ci::opt::disposer< faked_disposer >
100 typedef ci::SplitListSet< rcu_type, ord_list,
101 ci::split_list::make_traits<
105 static_assert( set::traits::dynamic_bucket_table, "Set has static bucket table" );
110 void IntrusiveHashSetHdrTest::split_dyn_RCU_GPI_member_less()
112 typedef member_int_item< ci::split_list::node< ci::michael_list::node<rcu_type> > > item;
113 typedef ci::MichaelList< rcu_type
115 ,ci::michael_list::make_traits<
116 ci::opt::hook< ci::michael_list::member_hook<
117 offsetof( item, hMember ),
120 ,co::less< less<item> >
121 ,ci::opt::disposer< faked_disposer >
125 typedef ci::SplitListSet< rcu_type, ord_list,
126 ci::split_list::make_traits<
128 ,co::memory_model<co::v::relaxed_ordering>
131 static_assert( set::traits::dynamic_bucket_table, "Set has static bucket table" );
136 void IntrusiveHashSetHdrTest::split_dyn_RCU_GPI_member_cmpmix()
138 typedef member_int_item< ci::split_list::node< ci::michael_list::node<rcu_type> > > item;
139 typedef ci::MichaelList< rcu_type
141 ,ci::michael_list::make_traits<
142 ci::opt::hook< ci::michael_list::member_hook<
143 offsetof( item, hMember ),
146 ,co::compare< cmp<item> >
147 ,co::less< less<item> >
148 ,ci::opt::disposer< faked_disposer >
152 typedef ci::SplitListSet< rcu_type, ord_list,
153 ci::split_list::make_traits<
155 ,co::item_counter< simple_item_counter >
156 ,co::memory_model<co::v::sequential_consistent>
159 static_assert( set::traits::dynamic_bucket_table, "Set has static bucket table" );
165 // Static bucket table
166 void IntrusiveHashSetHdrTest::split_st_RCU_GPI_base_cmp()
168 typedef base_int_item< ci::split_list::node< ci::michael_list::node<rcu_type> > > item;
169 typedef ci::MichaelList< rcu_type
171 ,ci::michael_list::make_traits<
172 ci::opt::hook< ci::michael_list::base_hook< co::gc<rcu_type> > >
173 ,co::compare< cmp<item> >
174 ,ci::opt::disposer< faked_disposer >
178 typedef ci::SplitListSet< rcu_type, ord_list,
179 ci::split_list::make_traits<
181 ,ci::split_list::dynamic_bucket_table<false>
182 ,co::memory_model<co::v::relaxed_ordering>
185 static_assert( !set::traits::dynamic_bucket_table, "Set has dynamic bucket table" );
190 void IntrusiveHashSetHdrTest::split_st_RCU_GPI_base_less()
192 typedef base_int_item< ci::split_list::node< ci::michael_list::node<rcu_type> > > item;
193 typedef ci::MichaelList< rcu_type
195 ,ci::michael_list::make_traits<
196 ci::opt::hook< ci::michael_list::base_hook< co::gc<rcu_type> > >
197 ,co::less< less<item> >
198 ,ci::opt::disposer< faked_disposer >
202 typedef ci::SplitListSet< rcu_type, ord_list,
203 ci::split_list::make_traits<
205 ,ci::split_list::dynamic_bucket_table<false>
206 ,co::memory_model<co::v::sequential_consistent>
209 static_assert( !set::traits::dynamic_bucket_table, "Set has dynamic bucket table" );
214 void IntrusiveHashSetHdrTest::split_st_RCU_GPI_base_cmpmix()
216 typedef base_int_item< ci::split_list::node<ci::michael_list::node<rcu_type> > > item;
217 typedef ci::MichaelList< rcu_type
219 ,ci::michael_list::make_traits<
220 ci::opt::hook< ci::michael_list::base_hook< co::gc<rcu_type> > >
221 ,co::less< less<item> >
222 ,co::compare< cmp<item> >
223 ,ci::opt::disposer< faked_disposer >
227 typedef ci::SplitListSet< rcu_type, ord_list,
228 ci::split_list::make_traits<
230 ,co::item_counter< simple_item_counter >
231 ,ci::split_list::dynamic_bucket_table<false>
234 static_assert( !set::traits::dynamic_bucket_table, "Set has dynamic bucket table" );
239 void IntrusiveHashSetHdrTest::split_st_RCU_GPI_member_cmp()
241 typedef member_int_item< ci::split_list::node< ci::michael_list::node<rcu_type> > > item;
242 typedef ci::MichaelList< rcu_type
244 ,ci::michael_list::make_traits<
245 ci::opt::hook< ci::michael_list::member_hook<
246 offsetof( item, hMember ),
249 ,co::compare< cmp<item> >
250 ,ci::opt::disposer< faked_disposer >
254 typedef ci::SplitListSet< rcu_type, ord_list,
255 ci::split_list::make_traits<
257 ,ci::split_list::dynamic_bucket_table<false>
258 ,co::memory_model<co::v::relaxed_ordering>
261 static_assert( !set::traits::dynamic_bucket_table, "Set has dynamic bucket table" );
266 void IntrusiveHashSetHdrTest::split_st_RCU_GPI_member_less()
268 typedef member_int_item< ci::split_list::node< ci::michael_list::node<rcu_type> > > item;
269 typedef ci::MichaelList< rcu_type
271 ,ci::michael_list::make_traits<
272 ci::opt::hook< ci::michael_list::member_hook<
273 offsetof( item, hMember ),
276 ,co::less< less<item> >
277 ,ci::opt::disposer< faked_disposer >
281 typedef ci::SplitListSet< rcu_type, ord_list,
282 ci::split_list::make_traits<
283 ci::split_list::dynamic_bucket_table<false>
284 ,co::hash< hash_int >
285 ,co::memory_model<co::v::sequential_consistent>
288 static_assert( !set::traits::dynamic_bucket_table, "Set has dynamic bucket table" );
293 void IntrusiveHashSetHdrTest::split_st_RCU_GPI_member_cmpmix()
295 typedef member_int_item< ci::split_list::node< ci::michael_list::node<rcu_type> > > item;
296 typedef ci::MichaelList< rcu_type
298 ,ci::michael_list::make_traits<
299 ci::opt::hook< ci::michael_list::member_hook<
300 offsetof( item, hMember ),
303 ,co::compare< cmp<item> >
304 ,co::less< less<item> >
305 ,ci::opt::disposer< faked_disposer >
309 typedef ci::SplitListSet< rcu_type, ord_list,
310 ci::split_list::make_traits<
312 ,co::item_counter< simple_item_counter >
313 ,ci::split_list::dynamic_bucket_table<false>
316 static_assert( !set::traits::dynamic_bucket_table, "Set has dynamic bucket table" );
321 void IntrusiveHashSetHdrTest::split_dyn_RCU_GPI_base_cmpmix_stat()
323 typedef base_int_item< ci::split_list::node<ci::michael_list::node<rcu_type> > > item;
324 struct list_traits : public ci::michael_list::traits
326 typedef ci::michael_list::base_hook< co::gc<rcu_type> > hook;
327 typedef IntrusiveHashSetHdrTest::less<item> less;
328 typedef cmp<item> compare;
329 typedef faked_disposer disposer;
331 typedef ci::MichaelList< rcu_type, item, list_traits > ord_list;
333 struct set_traits : public ci::split_list::make_traits<ci::split_list::dynamic_bucket_table<true> >::type
335 typedef hash_int hash;
336 typedef simple_item_counter item_counter;
337 typedef ci::split_list::stat<> stat;
339 typedef ci::SplitListSet< rcu_type, ord_list, set_traits > set;
341 static_assert( set::traits::dynamic_bucket_table, "Set has static bucket table" );
346 void IntrusiveHashSetHdrTest::split_dyn_RCU_GPI_member_cmpmix_stat()
348 typedef member_int_item< ci::split_list::node< ci::michael_list::node<rcu_type> > > item;
350 public ci::michael_list::make_traits<
351 ci::opt::hook< ci::michael_list::member_hook<
352 offsetof( item, hMember ),
355 ,co::compare< cmp<item> >
356 ,co::less< less<item> >
357 ,ci::opt::disposer< faked_disposer >
360 typedef ci::MichaelList< rcu_type, item, list_traits > ord_list;
363 public ci::split_list::make_traits<
365 ,co::item_counter< simple_item_counter >
366 ,co::memory_model<co::v::sequential_consistent>
367 ,co::stat< ci::split_list::stat<>>
370 typedef ci::SplitListSet< rcu_type, ord_list, set_traits > set;
371 static_assert( set::traits::dynamic_bucket_table, "Set has static bucket table" );
376 void IntrusiveHashSetHdrTest::split_st_RCU_GPI_base_cmpmix_stat()
378 typedef base_int_item< ci::split_list::node<ci::michael_list::node<rcu_type> > > item;
379 typedef ci::MichaelList< rcu_type
381 ,ci::michael_list::make_traits<
382 ci::opt::hook< ci::michael_list::base_hook< co::gc<rcu_type> > >
383 ,co::less< less<item> >
384 ,co::compare< cmp<item> >
385 ,ci::opt::disposer< faked_disposer >
389 typedef ci::SplitListSet< rcu_type, ord_list,
390 ci::split_list::make_traits<
392 ,co::item_counter< simple_item_counter >
393 ,ci::split_list::dynamic_bucket_table<false>
394 ,co::stat< ci::split_list::stat<>>
397 static_assert( !set::traits::dynamic_bucket_table, "Set has dynamic bucket table" );
402 void IntrusiveHashSetHdrTest::split_st_RCU_GPI_member_cmpmix_stat()
404 typedef member_int_item< ci::split_list::node< ci::michael_list::node<rcu_type> > > item;
405 typedef ci::MichaelList< rcu_type
407 ,ci::michael_list::make_traits<
408 ci::opt::hook< ci::michael_list::member_hook<
409 offsetof( item, hMember ),
412 ,co::compare< cmp<item> >
413 ,co::less< less<item> >
414 ,ci::opt::disposer< faked_disposer >
418 typedef ci::SplitListSet< rcu_type, ord_list,
419 ci::split_list::make_traits<
421 ,co::item_counter< simple_item_counter >
422 ,ci::split_list::dynamic_bucket_table<false>
423 ,co::stat< ci::split_list::stat<> >
426 static_assert( !set::traits::dynamic_bucket_table, "Set has dynamic bucket table" );