3 #include "set/hdr_intrusive_set.h"
4 #include <cds/urcu/signal_buffered.h>
5 #include <cds/intrusive/lazy_list_rcu.h>
6 #include <cds/intrusive/split_list_rcu.h>
9 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
11 typedef cds::urcu::gc< cds::urcu::signal_buffered<> > rcu_type;
15 void IntrusiveHashSetHdrTest::split_dyn_RCU_SHB_base_cmp_lazy()
17 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
18 typedef base_int_item< ci::split_list::node< ci::lazy_list::node<rcu_type> > > item;
19 typedef ci::LazyList< rcu_type
21 ,ci::lazy_list::make_traits<
22 ci::opt::hook< ci::lazy_list::base_hook< co::gc<rcu_type> > >
23 ,co::compare< cmp<item> >
24 ,ci::opt::disposer< faked_disposer >
28 typedef ci::SplitListSet< rcu_type, ord_list,
29 ci::split_list::make_traits<
31 ,ci::split_list::dynamic_bucket_table<true>
32 ,co::memory_model<co::v::relaxed_ordering>
35 static_assert( set::traits::dynamic_bucket_table, "Set has static bucket table" );
41 void IntrusiveHashSetHdrTest::split_dyn_RCU_SHB_base_less_lazy()
43 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
44 typedef base_int_item< ci::split_list::node< ci::lazy_list::node<rcu_type> > > item;
45 typedef ci::LazyList< rcu_type
47 ,ci::lazy_list::make_traits<
48 ci::opt::hook< ci::lazy_list::base_hook< co::gc<rcu_type> > >
49 ,co::less< less<item> >
50 ,ci::opt::disposer< faked_disposer >
54 typedef ci::SplitListSet< rcu_type, ord_list,
55 ci::split_list::make_traits<
57 ,co::memory_model<co::v::sequential_consistent>
60 static_assert( set::traits::dynamic_bucket_table, "Set has static bucket table" );
66 void IntrusiveHashSetHdrTest::split_dyn_RCU_SHB_base_cmpmix_lazy()
68 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
69 typedef base_int_item< ci::split_list::node<ci::lazy_list::node<rcu_type> > > item;
70 typedef ci::LazyList< rcu_type
72 ,ci::lazy_list::make_traits<
73 ci::opt::hook< ci::lazy_list::base_hook< co::gc<rcu_type> > >
74 ,co::less< less<item> >
75 ,co::compare< cmp<item> >
76 ,ci::opt::disposer< faked_disposer >
80 typedef ci::SplitListSet< rcu_type, ord_list,
81 ci::split_list::make_traits<
83 ,co::item_counter< simple_item_counter >
84 ,ci::split_list::dynamic_bucket_table<true>
87 static_assert( set::traits::dynamic_bucket_table, "Set has static bucket table" );
93 void IntrusiveHashSetHdrTest::split_dyn_RCU_SHB_member_cmp_lazy()
95 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
96 typedef member_int_item< ci::split_list::node< ci::lazy_list::node<rcu_type> > > item;
97 typedef ci::LazyList< rcu_type
99 ,ci::lazy_list::make_traits<
100 ci::opt::hook< ci::lazy_list::member_hook<
101 offsetof( item, hMember ),
104 ,co::compare< cmp<item> >
105 ,ci::opt::disposer< faked_disposer >
109 typedef ci::SplitListSet< rcu_type, ord_list,
110 ci::split_list::make_traits<
112 ,co::memory_model<co::v::relaxed_ordering>
115 static_assert( set::traits::dynamic_bucket_table, "Set has static bucket table" );
121 void IntrusiveHashSetHdrTest::split_dyn_RCU_SHB_member_less_lazy()
123 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
124 typedef member_int_item< ci::split_list::node< ci::lazy_list::node<rcu_type> > > item;
125 typedef ci::LazyList< rcu_type
127 ,ci::lazy_list::make_traits<
128 ci::opt::hook< ci::lazy_list::member_hook<
129 offsetof( item, hMember ),
132 ,co::less< less<item> >
133 ,ci::opt::disposer< faked_disposer >
137 typedef ci::SplitListSet< rcu_type, ord_list,
138 ci::split_list::make_traits<
140 ,co::memory_model<co::v::sequential_consistent>
143 static_assert( set::traits::dynamic_bucket_table, "Set has static bucket table" );
149 void IntrusiveHashSetHdrTest::split_dyn_RCU_SHB_member_cmpmix_lazy()
151 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
152 typedef member_int_item< ci::split_list::node< ci::lazy_list::node<rcu_type> > > item;
153 typedef ci::LazyList< rcu_type
155 ,ci::lazy_list::make_traits<
156 ci::opt::hook< ci::lazy_list::member_hook<
157 offsetof( item, hMember ),
160 ,co::compare< cmp<item> >
161 ,co::less< less<item> >
162 ,ci::opt::disposer< faked_disposer >
166 typedef ci::SplitListSet< rcu_type, ord_list,
167 ci::split_list::make_traits<
169 ,co::item_counter< simple_item_counter >
172 static_assert( set::traits::dynamic_bucket_table, "Set has static bucket table" );
179 // Static bucket table
180 void IntrusiveHashSetHdrTest::split_st_RCU_SHB_base_cmp_lazy()
182 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
183 typedef base_int_item< ci::split_list::node< ci::lazy_list::node<rcu_type> > > item;
184 typedef ci::LazyList< rcu_type
186 ,ci::lazy_list::make_traits<
187 ci::opt::hook< ci::lazy_list::base_hook< co::gc<rcu_type> > >
188 ,co::compare< cmp<item> >
189 ,ci::opt::disposer< faked_disposer >
193 typedef ci::SplitListSet< rcu_type, ord_list,
194 ci::split_list::make_traits<
196 ,ci::split_list::dynamic_bucket_table<false>
197 ,co::memory_model<co::v::relaxed_ordering>
200 static_assert( !set::traits::dynamic_bucket_table, "Set has dynamic bucket table" );
206 void IntrusiveHashSetHdrTest::split_st_RCU_SHB_base_less_lazy()
208 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
209 typedef base_int_item< ci::split_list::node< ci::lazy_list::node<rcu_type> > > item;
210 typedef ci::LazyList< rcu_type
212 ,ci::lazy_list::make_traits<
213 ci::opt::hook< ci::lazy_list::base_hook< co::gc<rcu_type> > >
214 ,co::less< less<item> >
215 ,ci::opt::disposer< faked_disposer >
219 typedef ci::SplitListSet< rcu_type, ord_list,
220 ci::split_list::make_traits<
222 ,ci::split_list::dynamic_bucket_table<false>
223 ,co::memory_model<co::v::sequential_consistent>
226 static_assert( !set::traits::dynamic_bucket_table, "Set has dynamic bucket table" );
232 void IntrusiveHashSetHdrTest::split_st_RCU_SHB_base_cmpmix_lazy()
234 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
235 typedef base_int_item< ci::split_list::node<ci::lazy_list::node<rcu_type> > > item;
236 typedef ci::LazyList< rcu_type
238 ,ci::lazy_list::make_traits<
239 ci::opt::hook< ci::lazy_list::base_hook< co::gc<rcu_type> > >
240 ,co::less< less<item> >
241 ,co::compare< cmp<item> >
242 ,ci::opt::disposer< faked_disposer >
246 typedef ci::SplitListSet< rcu_type, ord_list,
247 ci::split_list::make_traits<
249 ,co::item_counter< simple_item_counter >
250 ,ci::split_list::dynamic_bucket_table<false>
253 static_assert( !set::traits::dynamic_bucket_table, "Set has dynamic bucket table" );
259 void IntrusiveHashSetHdrTest::split_st_RCU_SHB_member_cmp_lazy()
261 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
262 typedef member_int_item< ci::split_list::node< ci::lazy_list::node<rcu_type> > > item;
263 typedef ci::LazyList< rcu_type
265 ,ci::lazy_list::make_traits<
266 ci::opt::hook< ci::lazy_list::member_hook<
267 offsetof( item, hMember ),
270 ,co::compare< cmp<item> >
271 ,ci::opt::disposer< faked_disposer >
275 typedef ci::SplitListSet< rcu_type, ord_list,
276 ci::split_list::make_traits<
278 ,ci::split_list::dynamic_bucket_table<false>
279 ,co::memory_model<co::v::relaxed_ordering>
282 static_assert( !set::traits::dynamic_bucket_table, "Set has dynamic bucket table" );
288 void IntrusiveHashSetHdrTest::split_st_RCU_SHB_member_less_lazy()
290 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
291 typedef member_int_item< ci::split_list::node< ci::lazy_list::node<rcu_type> > > item;
292 typedef ci::LazyList< rcu_type
294 ,ci::lazy_list::make_traits<
295 ci::opt::hook< ci::lazy_list::member_hook<
296 offsetof( item, hMember ),
299 ,co::less< less<item> >
300 ,ci::opt::disposer< faked_disposer >
304 typedef ci::SplitListSet< rcu_type, ord_list,
305 ci::split_list::make_traits<
306 ci::split_list::dynamic_bucket_table<false>
307 ,co::hash< hash_int >
308 ,co::memory_model<co::v::sequential_consistent>
311 static_assert( !set::traits::dynamic_bucket_table, "Set has dynamic bucket table" );
317 void IntrusiveHashSetHdrTest::split_st_RCU_SHB_member_cmpmix_lazy()
319 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
320 typedef member_int_item< ci::split_list::node< ci::lazy_list::node<rcu_type> > > item;
321 typedef ci::LazyList< rcu_type
323 ,ci::lazy_list::make_traits<
324 ci::opt::hook< ci::lazy_list::member_hook<
325 offsetof( item, hMember ),
328 ,co::compare< cmp<item> >
329 ,co::less< less<item> >
330 ,ci::opt::disposer< faked_disposer >
334 typedef ci::SplitListSet< rcu_type, ord_list,
335 ci::split_list::make_traits<
337 ,co::item_counter< simple_item_counter >
338 ,ci::split_list::dynamic_bucket_table<false>
341 static_assert( !set::traits::dynamic_bucket_table, "Set has dynamic bucket table" );
347 void IntrusiveHashSetHdrTest::split_dyn_RCU_SHB_base_cmpmix_stat_lazy()
349 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
350 typedef base_int_item< ci::split_list::node<ci::lazy_list::node<rcu_type> > > item;
351 struct list_traits : public ci::lazy_list::traits
353 typedef ci::lazy_list::base_hook< co::gc<rcu_type> > hook;
354 typedef IntrusiveHashSetHdrTest::less< item > less;
355 typedef cmp<item> compare;
356 typedef faked_disposer disposer;
358 typedef ci::LazyList< rcu_type, item, list_traits > ord_list;
360 struct set_traits : public ci::split_list::make_traits<ci::split_list::dynamic_bucket_table<true>>::type
362 typedef hash_int hash;
363 typedef simple_item_counter item_counter;
364 typedef ci::split_list::stat<> stat;
366 typedef ci::SplitListSet< rcu_type, ord_list, set_traits > set;
367 static_assert( set::traits::dynamic_bucket_table, "Set has static bucket table" );
373 void IntrusiveHashSetHdrTest::split_dyn_RCU_SHB_member_cmpmix_stat_lazy()
375 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
376 typedef member_int_item< ci::split_list::node< ci::lazy_list::node<rcu_type> > > item;
378 public ci::lazy_list::make_traits<
379 ci::opt::hook< ci::lazy_list::member_hook<
380 offsetof( item, hMember ),
383 ,co::compare< cmp<item> >
384 ,co::less< less<item> >
385 ,ci::opt::disposer< faked_disposer >
388 typedef ci::LazyList< rcu_type, item, list_traits > ord_list;
391 public ci::split_list::make_traits<
393 ,co::item_counter< simple_item_counter >
394 ,co::stat< ci::split_list::stat<> >
397 typedef ci::SplitListSet< rcu_type, ord_list, set_traits > set;
398 static_assert( set::traits::dynamic_bucket_table, "Set has static bucket table" );
404 void IntrusiveHashSetHdrTest::split_st_RCU_SHB_base_cmpmix_stat_lazy()
406 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
407 typedef base_int_item< ci::split_list::node<ci::lazy_list::node<rcu_type> > > item;
408 typedef ci::LazyList< rcu_type
410 ,ci::lazy_list::make_traits<
411 ci::opt::hook< ci::lazy_list::base_hook< co::gc<rcu_type> > >
412 ,co::less< less<item> >
413 ,co::compare< cmp<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" );
432 void IntrusiveHashSetHdrTest::split_st_RCU_SHB_member_cmpmix_stat_lazy()
434 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
435 typedef member_int_item< ci::split_list::node< ci::lazy_list::node<rcu_type> > > item;
436 typedef ci::LazyList< rcu_type
438 ,ci::lazy_list::make_traits<
439 ci::opt::hook< ci::lazy_list::member_hook<
440 offsetof( item, hMember ),
443 ,co::compare< cmp<item> >
444 ,co::less< less<item> >
445 ,ci::opt::disposer< faked_disposer >
449 typedef ci::SplitListSet< rcu_type, ord_list,
450 ci::split_list::make_traits<
452 ,co::item_counter< simple_item_counter >
453 ,ci::split_list::dynamic_bucket_table<false>
454 ,co::stat< ci::split_list::stat<>>
457 static_assert( !set::traits::dynamic_bucket_table, "Set has dynamic bucket table" );