3 #include "set/hdr_set.h"
4 #include <cds/urcu/signal_threaded.h>
5 #include <cds/container/michael_list_rcu.h>
6 #include <cds/container/split_list_set_rcu.h>
10 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
12 typedef cds::urcu::gc< cds::urcu::signal_threaded<> > rcu_type;
14 struct RCU_SHT_cmp_traits: public cc::split_list::traits
16 typedef cc::michael_list_tag ordered_list;
17 typedef HashSetHdrTest::hash_int hash;
18 typedef HashSetHdrTest::simple_item_counter item_counter;
19 typedef cc::opt::v::relaxed_ordering memory_model;
20 enum { dynamic_bucket_table = false };
22 struct ordered_list_traits: public cc::michael_list::traits
24 typedef HashSetHdrTest::cmp<HashSetHdrTest::item> compare;
28 struct RCU_SHT_less_traits: public cc::split_list::traits
30 typedef cc::michael_list_tag ordered_list;
31 typedef HashSetHdrTest::hash_int hash;
32 typedef HashSetHdrTest::simple_item_counter item_counter;
33 typedef cc::opt::v::sequential_consistent memory_model;
34 enum { dynamic_bucket_table = false };
36 struct ordered_list_traits: public cc::michael_list::traits
38 typedef HashSetHdrTest::less<HashSetHdrTest::item> less;
42 struct RCU_cmpmix_traits: public cc::split_list::traits
44 typedef cc::michael_list_tag ordered_list;
45 typedef HashSetHdrTest::hash_int hash;
46 typedef HashSetHdrTest::simple_item_counter item_counter;
48 struct ordered_list_traits: public cc::michael_list::traits
50 typedef HashSetHdrTest::cmp<HashSetHdrTest::item> compare;
51 typedef HashSetHdrTest::less<HashSetHdrTest::item> less;
55 struct RCU_cmpmix_stat_traits : public RCU_cmpmix_traits
57 typedef cc::split_list::stat<> stat;
63 void HashSetHdrTest::Split_RCU_SHT_cmp()
65 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
66 // traits-based version
67 typedef cc::SplitListSet< rcu_type, item, RCU_SHT_cmp_traits > set;
69 test_int_rcu_michael_list< set >();
71 // option-based version
72 typedef cc::SplitListSet< rcu_type, item,
73 cc::split_list::make_traits<
74 cc::split_list::ordered_list<cc::michael_list_tag>
75 ,cc::opt::hash< hash_int >
76 ,cc::opt::item_counter< simple_item_counter >
77 ,cc::opt::memory_model< cc::opt::v::relaxed_ordering >
78 ,cc::split_list::dynamic_bucket_table< true >
79 ,cc::split_list::ordered_list_traits<
80 cc::michael_list::make_traits<
81 cc::opt::compare< cmp<item> >
86 test_int_rcu_michael_list< opt_set >();
90 void HashSetHdrTest::Split_RCU_SHT_less()
92 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
93 // traits-based version
94 typedef cc::SplitListSet< rcu_type, item, RCU_SHT_less_traits > set;
96 test_int_rcu_michael_list< set >();
98 // option-based version
99 typedef cc::SplitListSet< rcu_type, item,
100 cc::split_list::make_traits<
101 cc::split_list::ordered_list<cc::michael_list_tag>
102 ,cc::opt::hash< hash_int >
103 ,cc::opt::item_counter< simple_item_counter >
104 ,cc::opt::memory_model< cc::opt::v::sequential_consistent >
105 ,cc::split_list::dynamic_bucket_table< false >
106 ,cc::split_list::ordered_list_traits<
107 cc::michael_list::make_traits<
108 cc::opt::less< less<item> >
113 test_int_rcu_michael_list< opt_set >();
117 void HashSetHdrTest::Split_RCU_SHT_cmpmix()
119 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
120 // traits-based version
121 typedef cc::SplitListSet< rcu_type, item, RCU_cmpmix_traits > set;
122 test_int_rcu_michael_list< set >();
124 // option-based version
125 typedef cc::SplitListSet< rcu_type, item,
126 cc::split_list::make_traits<
127 cc::split_list::ordered_list<cc::michael_list_tag>
128 ,cc::opt::hash< hash_int >
129 ,cc::opt::item_counter< simple_item_counter >
130 ,cc::split_list::ordered_list_traits<
131 cc::michael_list::make_traits<
132 cc::opt::less< less<item> >
133 ,cc::opt::compare< cmp<item> >
138 test_int_rcu_michael_list< opt_set >();
142 void HashSetHdrTest::Split_RCU_SHT_cmpmix_stat()
144 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
145 // traits-based version
146 typedef cc::SplitListSet< rcu_type, item, RCU_cmpmix_stat_traits > set;
147 test_int_rcu_michael_list< set >();
149 // option-based version
150 typedef cc::SplitListSet< rcu_type, item,
151 cc::split_list::make_traits<
152 cc::split_list::ordered_list<cc::michael_list_tag>
153 ,cc::opt::hash< hash_int >
154 ,cc::opt::item_counter< simple_item_counter >
155 ,cc::opt::stat< cc::split_list::stat<>>
156 ,cc::split_list::ordered_list_traits<
157 cc::michael_list::make_traits<
158 cc::opt::less< less<item> >
159 ,cc::opt::compare< cmp<item> >
164 test_int_rcu_michael_list< opt_set >();