3 #include "map/hdr_feldman_hashmap.h"
4 #include <cds/urcu/signal_threaded.h>
5 #include <cds/container/feldman_hashmap_rcu.h>
6 #include "unit/print_feldman_hashset_stat.h"
9 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
11 typedef cds::urcu::gc< cds::urcu::signal_threaded<>> rcu_type;
15 void FeldmanHashMapHdrTest::rcu_sht_nohash()
17 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
18 typedef cc::FeldmanHashMap< rcu_type, size_t, Item > map_type;
20 test_rcu<map_type>(4, 2);
24 void FeldmanHashMapHdrTest::rcu_sht_stdhash()
26 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
27 struct traits : public cc::feldman_hashmap::traits {
28 typedef std::hash<size_t> hash;
30 typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type;
32 test_rcu<map_type>(4, 2);
36 void FeldmanHashMapHdrTest::rcu_sht_hash128()
38 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
39 struct traits : public cc::feldman_hashmap::traits {
40 typedef hash128::make hash;
41 typedef hash128::less less;
43 typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type;
44 test_rcu<map_type>(4, 2);
46 typedef cc::FeldmanHashMap< rcu_type, size_t, Item,
47 typename cc::feldman_hashmap::make_traits<
48 co::hash< hash128::make >
49 , co::less< hash128::less >
52 test_rcu<map_type2>(4, 2);
56 void FeldmanHashMapHdrTest::rcu_sht_nohash_stat()
58 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
59 struct traits : public cc::feldman_hashmap::traits {
60 typedef cc::feldman_hashmap::stat<> stat;
62 typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type;
63 test_rcu<map_type>(4, 2);
65 typedef cc::FeldmanHashMap< rcu_type, size_t, Item,
66 typename cc::feldman_hashmap::make_traits<
67 co::stat< cc::feldman_hashmap::stat<>>
70 test_rcu<map_type2>(4, 2);
74 void FeldmanHashMapHdrTest::rcu_sht_stdhash_stat()
76 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
77 struct traits : public cc::feldman_hashmap::traits {
78 typedef std::hash<size_t> hash;
79 typedef cc::feldman_hashmap::stat<> stat;
81 typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type;
82 test_rcu<map_type>(4, 2);
84 typedef cc::FeldmanHashMap< rcu_type, size_t, Item,
85 typename cc::feldman_hashmap::make_traits<
86 co::stat< cc::feldman_hashmap::stat<>>
87 ,co::hash<std::hash<size_t>>
90 test_rcu<map_type2>(4, 2);
94 void FeldmanHashMapHdrTest::rcu_sht_hash128_stat()
96 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
97 struct traits : public cc::feldman_hashmap::traits {
98 typedef cc::feldman_hashmap::stat<> stat;
99 typedef hash128::make hash;
100 typedef hash128::cmp compare;
102 typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type;
103 test_rcu<map_type>(4, 2);
105 typedef cc::FeldmanHashMap< rcu_type, size_t, Item,
106 typename cc::feldman_hashmap::make_traits<
107 co::stat< cc::feldman_hashmap::stat<>>
108 , co::hash< hash128::make >
109 , co::compare< hash128::cmp >
112 test_rcu<map_type2>(4, 2);
116 void FeldmanHashMapHdrTest::rcu_sht_nohash_5_3()
118 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
119 typedef cc::FeldmanHashMap< rcu_type, size_t, Item > map_type;
121 test_rcu<map_type>(5, 3);
125 void FeldmanHashMapHdrTest::rcu_sht_stdhash_5_3()
127 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
128 struct traits : public cc::feldman_hashmap::traits {
129 typedef std::hash<size_t> hash;
131 typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type;
133 test_rcu<map_type>(5, 3);
137 void FeldmanHashMapHdrTest::rcu_sht_nohash_5_3_stat()
139 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
140 struct traits : public cc::feldman_hashmap::traits {
141 typedef cc::feldman_hashmap::stat<> stat;
142 typedef cds::backoff::empty back_off;
144 typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type;
145 test_rcu<map_type>(5, 3);
147 typedef cc::FeldmanHashMap< rcu_type, size_t, Item,
148 typename cc::feldman_hashmap::make_traits<
149 co::stat< cc::feldman_hashmap::stat<>>
150 , co::back_off< cds::backoff::empty >
153 test_rcu<map_type2>(5, 3);
157 void FeldmanHashMapHdrTest::rcu_sht_stdhash_5_3_stat()
159 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
160 struct traits : public cc::feldman_hashmap::traits {
161 typedef cc::feldman_hashmap::stat<> stat;
162 typedef cds::backoff::empty back_off;
163 typedef std::hash<size_t> hash;
165 typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type;
166 test_rcu<map_type>(5, 3);
168 typedef cc::FeldmanHashMap< rcu_type, size_t, Item,
169 typename cc::feldman_hashmap::make_traits<
170 co::stat< cc::feldman_hashmap::stat<>>
171 ,co::back_off< cds::backoff::empty >
172 ,co::hash< std::hash<size_t>>
175 test_rcu<map_type2>(5, 3);
179 void FeldmanHashMapHdrTest::rcu_sht_hash128_4_3()
181 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
182 struct traits : public cc::feldman_hashmap::traits {
183 typedef hash128::make hash;
184 typedef hash128::less less;
186 typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type;
187 test_rcu<map_type>(4, 3);
189 typedef cc::FeldmanHashMap< rcu_type, size_t, Item,
190 typename cc::feldman_hashmap::make_traits<
191 co::hash< hash128::make >
192 , co::less< hash128::less >
195 test_rcu<map_type2>(4, 3);
199 void FeldmanHashMapHdrTest::rcu_sht_hash128_4_3_stat()
201 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
202 struct traits : public cc::feldman_hashmap::traits {
203 typedef hash128::make hash;
204 typedef hash128::less less;
205 typedef cc::feldman_hashmap::stat<> stat;
206 typedef co::v::sequential_consistent memory_model;
208 typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type;
209 test_rcu<map_type>(4, 3);
211 typedef cc::FeldmanHashMap< rcu_type, size_t, Item,
212 typename cc::feldman_hashmap::make_traits<
213 co::hash< hash128::make >
214 , co::less< hash128::less >
215 , co::stat< cc::feldman_hashmap::stat<>>
216 , co::memory_model< co::v::sequential_consistent >
219 test_rcu<map_type2>(4, 3);