2 This file is a part of libcds - Concurrent Data Structures library
4 (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2017
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 #ifndef CDSUNIT_SET_TYPE_SKIP_LIST_H
32 #define CDSUNIT_SET_TYPE_SKIP_LIST_H
36 #include <cds/container/skip_list_set_hp.h>
37 #include <cds/container/skip_list_set_dhp.h>
38 #include <cds/container/skip_list_set_rcu.h>
40 #include <cds_test/stat_skiplist_out.h>
44 template <typename GC, typename T, typename Traits = cc::skip_list::traits >
45 class SkipListSet : public cc::SkipListSet<GC, T, Traits>
47 typedef cc::SkipListSet<GC, T, Traits> base_class;
49 template <typename Config>
50 SkipListSet( Config const& /*cfg*/ )
54 static CDS_CONSTEXPR bool const c_bExtractSupported = true;
55 static CDS_CONSTEXPR bool const c_bLoadFactorDepended = false;
56 static CDS_CONSTEXPR bool const c_bEraseExactKey = false;
59 struct tag_SkipListSet;
61 template <typename Key, typename Val>
62 struct set_type< tag_SkipListSet, Key, Val >: public set_type_base< Key, Val >
64 typedef set_type_base< Key, Val > base_class;
65 typedef typename base_class::key_val key_val;
66 typedef typename base_class::compare compare;
67 typedef typename base_class::less less;
68 typedef typename base_class::hash hash;
70 class traits_SkipListSet_less_turbo32: public cc::skip_list::make_traits <
72 ,cc::skip_list::random_level_generator< cc::skip_list::turbo32 >
73 ,co::item_counter< cds::atomicity::item_counter >
76 typedef SkipListSet< cds::gc::HP, key_val, traits_SkipListSet_less_turbo32 > SkipListSet_hp_less_turbo32;
77 typedef SkipListSet< cds::gc::DHP, key_val, traits_SkipListSet_less_turbo32 > SkipListSet_dhp_less_turbo32;
78 typedef SkipListSet< rcu_gpi, key_val, traits_SkipListSet_less_turbo32 > SkipListSet_rcu_gpi_less_turbo32;
79 typedef SkipListSet< rcu_gpb, key_val, traits_SkipListSet_less_turbo32 > SkipListSet_rcu_gpb_less_turbo32;
80 typedef SkipListSet< rcu_gpt, key_val, traits_SkipListSet_less_turbo32 > SkipListSet_rcu_gpt_less_turbo32;
81 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
82 typedef SkipListSet< rcu_shb, key_val, traits_SkipListSet_less_turbo32 > SkipListSet_rcu_shb_less_turbo32;
85 class traits_SkipListSet_less_turbo24: public cc::skip_list::make_traits <
87 ,cc::skip_list::random_level_generator< cc::skip_list::turbo24 >
88 ,co::item_counter< cds::atomicity::item_counter >
91 typedef SkipListSet< cds::gc::HP, key_val, traits_SkipListSet_less_turbo24 > SkipListSet_hp_less_turbo24;
92 typedef SkipListSet< cds::gc::DHP, key_val, traits_SkipListSet_less_turbo24 > SkipListSet_dhp_less_turbo24;
93 typedef SkipListSet< rcu_gpi, key_val, traits_SkipListSet_less_turbo24 > SkipListSet_rcu_gpi_less_turbo24;
94 typedef SkipListSet< rcu_gpb, key_val, traits_SkipListSet_less_turbo24 > SkipListSet_rcu_gpb_less_turbo24;
95 typedef SkipListSet< rcu_gpt, key_val, traits_SkipListSet_less_turbo24 > SkipListSet_rcu_gpt_less_turbo24;
96 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
97 typedef SkipListSet< rcu_shb, key_val, traits_SkipListSet_less_turbo24 > SkipListSet_rcu_shb_less_turbo24;
100 class traits_SkipListSet_less_turbo16: public cc::skip_list::make_traits <
102 ,cc::skip_list::random_level_generator< cc::skip_list::turbo16 >
103 ,co::item_counter< cds::atomicity::item_counter >
106 typedef SkipListSet< cds::gc::HP, key_val, traits_SkipListSet_less_turbo16 > SkipListSet_hp_less_turbo16;
107 typedef SkipListSet< cds::gc::DHP, key_val, traits_SkipListSet_less_turbo16 > SkipListSet_dhp_less_turbo16;
108 typedef SkipListSet< rcu_gpi, key_val, traits_SkipListSet_less_turbo16 > SkipListSet_rcu_gpi_less_turbo16;
109 typedef SkipListSet< rcu_gpb, key_val, traits_SkipListSet_less_turbo16 > SkipListSet_rcu_gpb_less_turbo16;
110 typedef SkipListSet< rcu_gpt, key_val, traits_SkipListSet_less_turbo16 > SkipListSet_rcu_gpt_less_turbo16;
111 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
112 typedef SkipListSet< rcu_shb, key_val, traits_SkipListSet_less_turbo16 > SkipListSet_rcu_shb_less_turbo16;
115 class traits_SkipListSet_less_turbo32_seqcst: public cc::skip_list::make_traits <
117 ,cc::skip_list::random_level_generator< cc::skip_list::turbo32 >
118 ,co::memory_model< co::v::sequential_consistent >
119 ,co::item_counter< cds::atomicity::item_counter >
122 typedef SkipListSet< cds::gc::HP, key_val, traits_SkipListSet_less_turbo32_seqcst > SkipListSet_hp_less_turbo32_seqcst;
123 typedef SkipListSet< cds::gc::DHP, key_val, traits_SkipListSet_less_turbo32_seqcst > SkipListSet_dhp_less_turbo32_seqcst;
124 typedef SkipListSet< rcu_gpi, key_val, traits_SkipListSet_less_turbo32_seqcst > SkipListSet_rcu_gpi_less_turbo32_seqcst;
125 typedef SkipListSet< rcu_gpb, key_val, traits_SkipListSet_less_turbo32_seqcst > SkipListSet_rcu_gpb_less_turbo32_seqcst;
126 typedef SkipListSet< rcu_gpt, key_val, traits_SkipListSet_less_turbo32_seqcst > SkipListSet_rcu_gpt_less_turbo32_seqcst;
127 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
128 typedef SkipListSet< rcu_shb, key_val, traits_SkipListSet_less_turbo32_seqcst > SkipListSet_rcu_shb_less_turbo32_seqcst;
131 class traits_SkipListSet_less_turbo32_stat: public cc::skip_list::make_traits <
133 ,cc::skip_list::random_level_generator< cc::skip_list::turbo32 >
134 ,co::stat< cc::skip_list::stat<> >
135 ,co::item_counter< cds::atomicity::item_counter >
138 typedef SkipListSet< cds::gc::HP, key_val, traits_SkipListSet_less_turbo32_stat > SkipListSet_hp_less_turbo32_stat;
139 typedef SkipListSet< cds::gc::DHP, key_val, traits_SkipListSet_less_turbo32_stat > SkipListSet_dhp_less_turbo32_stat;
140 typedef SkipListSet< rcu_gpi, key_val, traits_SkipListSet_less_turbo32_stat > SkipListSet_rcu_gpi_less_turbo32_stat;
141 typedef SkipListSet< rcu_gpb, key_val, traits_SkipListSet_less_turbo32_stat > SkipListSet_rcu_gpb_less_turbo32_stat;
142 typedef SkipListSet< rcu_gpt, key_val, traits_SkipListSet_less_turbo32_stat > SkipListSet_rcu_gpt_less_turbo32_stat;
143 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
144 typedef SkipListSet< rcu_shb, key_val, traits_SkipListSet_less_turbo32_stat > SkipListSet_rcu_shb_less_turbo32_stat;
147 class traits_SkipListSet_less_turbo24_stat: public cc::skip_list::make_traits <
149 ,cc::skip_list::random_level_generator< cc::skip_list::turbo24 >
150 ,co::stat< cc::skip_list::stat<> >
151 ,co::item_counter< cds::atomicity::item_counter >
154 typedef SkipListSet< cds::gc::HP, key_val, traits_SkipListSet_less_turbo24_stat > SkipListSet_hp_less_turbo24_stat;
155 typedef SkipListSet< cds::gc::DHP, key_val, traits_SkipListSet_less_turbo24_stat > SkipListSet_dhp_less_turbo24_stat;
156 typedef SkipListSet< rcu_gpi, key_val, traits_SkipListSet_less_turbo24_stat > SkipListSet_rcu_gpi_less_turbo24_stat;
157 typedef SkipListSet< rcu_gpb, key_val, traits_SkipListSet_less_turbo24_stat > SkipListSet_rcu_gpb_less_turbo24_stat;
158 typedef SkipListSet< rcu_gpt, key_val, traits_SkipListSet_less_turbo24_stat > SkipListSet_rcu_gpt_less_turbo24_stat;
159 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
160 typedef SkipListSet< rcu_shb, key_val, traits_SkipListSet_less_turbo24_stat > SkipListSet_rcu_shb_less_turbo24_stat;
163 class traits_SkipListSet_less_turbo16_stat: public cc::skip_list::make_traits <
165 ,cc::skip_list::random_level_generator< cc::skip_list::turbo16 >
166 ,co::stat< cc::skip_list::stat<> >
167 ,co::item_counter< cds::atomicity::item_counter >
170 typedef SkipListSet< cds::gc::HP, key_val, traits_SkipListSet_less_turbo16_stat > SkipListSet_hp_less_turbo16_stat;
171 typedef SkipListSet< cds::gc::DHP, key_val, traits_SkipListSet_less_turbo16_stat > SkipListSet_dhp_less_turbo16_stat;
172 typedef SkipListSet< rcu_gpi, key_val, traits_SkipListSet_less_turbo16_stat > SkipListSet_rcu_gpi_less_turbo16_stat;
173 typedef SkipListSet< rcu_gpb, key_val, traits_SkipListSet_less_turbo16_stat > SkipListSet_rcu_gpb_less_turbo16_stat;
174 typedef SkipListSet< rcu_gpt, key_val, traits_SkipListSet_less_turbo16_stat > SkipListSet_rcu_gpt_less_turbo16_stat;
175 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
176 typedef SkipListSet< rcu_shb, key_val, traits_SkipListSet_less_turbo16_stat > SkipListSet_rcu_shb_less_turbo16_stat;
179 class traits_SkipListSet_cmp_turbo32: public cc::skip_list::make_traits <
180 co::compare< compare >
181 ,cc::skip_list::random_level_generator< cc::skip_list::turbo32 >
182 ,co::item_counter< cds::atomicity::item_counter >
185 typedef SkipListSet< cds::gc::HP, key_val, traits_SkipListSet_cmp_turbo32 > SkipListSet_hp_cmp_turbo32;
186 typedef SkipListSet< cds::gc::DHP, key_val, traits_SkipListSet_cmp_turbo32 > SkipListSet_dhp_cmp_turbo32;
187 typedef SkipListSet< rcu_gpi, key_val, traits_SkipListSet_cmp_turbo32 > SkipListSet_rcu_gpi_cmp_turbo32;
188 typedef SkipListSet< rcu_gpb, key_val, traits_SkipListSet_cmp_turbo32 > SkipListSet_rcu_gpb_cmp_turbo32;
189 typedef SkipListSet< rcu_gpt, key_val, traits_SkipListSet_cmp_turbo32 > SkipListSet_rcu_gpt_cmp_turbo32;
190 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
191 typedef SkipListSet< rcu_shb, key_val, traits_SkipListSet_cmp_turbo32 > SkipListSet_rcu_shb_cmp_turbo32;
194 class traits_SkipListSet_cmp_turbo32_stat: public cc::skip_list::make_traits <
195 co::compare< compare >
196 ,cc::skip_list::random_level_generator< cc::skip_list::turbo32 >
197 ,co::stat< cc::skip_list::stat<> >
198 ,co::item_counter< cds::atomicity::item_counter >
201 typedef SkipListSet< cds::gc::HP, key_val, traits_SkipListSet_cmp_turbo32_stat > SkipListSet_hp_cmp_turbo32_stat;
202 typedef SkipListSet< cds::gc::DHP, key_val, traits_SkipListSet_cmp_turbo32_stat > SkipListSet_dhp_cmp_turbo32_stat;
203 typedef SkipListSet< rcu_gpi, key_val, traits_SkipListSet_cmp_turbo32_stat > SkipListSet_rcu_gpi_cmp_turbo32_stat;
204 typedef SkipListSet< rcu_gpb, key_val, traits_SkipListSet_cmp_turbo32_stat > SkipListSet_rcu_gpb_cmp_turbo32_stat;
205 typedef SkipListSet< rcu_gpt, key_val, traits_SkipListSet_cmp_turbo32_stat > SkipListSet_rcu_gpt_cmp_turbo32_stat;
206 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
207 typedef SkipListSet< rcu_shb, key_val, traits_SkipListSet_cmp_turbo32_stat > SkipListSet_rcu_shb_cmp_turbo32_stat;
210 class traits_SkipListSet_less_xorshift32: public cc::skip_list::make_traits <
212 ,cc::skip_list::random_level_generator< cc::skip_list::xorshift32 >
213 ,co::item_counter< cds::atomicity::item_counter >
216 typedef SkipListSet< cds::gc::HP, key_val, traits_SkipListSet_less_xorshift32 > SkipListSet_hp_less_xorshift32;
217 typedef SkipListSet< cds::gc::DHP, key_val, traits_SkipListSet_less_xorshift32 > SkipListSet_dhp_less_xorshift32;
218 typedef SkipListSet< rcu_gpi, key_val, traits_SkipListSet_less_xorshift32 > SkipListSet_rcu_gpi_less_xorshift32;
219 typedef SkipListSet< rcu_gpb, key_val, traits_SkipListSet_less_xorshift32 > SkipListSet_rcu_gpb_less_xorshift32;
220 typedef SkipListSet< rcu_gpt, key_val, traits_SkipListSet_less_xorshift32 > SkipListSet_rcu_gpt_less_xorshift32;
221 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
222 typedef SkipListSet< rcu_shb, key_val, traits_SkipListSet_less_xorshift32 > SkipListSet_rcu_shb_less_xorshift32;
225 class traits_SkipListSet_less_xorshift24: public cc::skip_list::make_traits <
227 ,cc::skip_list::random_level_generator< cc::skip_list::xorshift24 >
228 ,co::item_counter< cds::atomicity::item_counter >
231 typedef SkipListSet< cds::gc::HP, key_val, traits_SkipListSet_less_xorshift24 > SkipListSet_hp_less_xorshift24;
232 typedef SkipListSet< cds::gc::DHP, key_val, traits_SkipListSet_less_xorshift24 > SkipListSet_dhp_less_xorshift24;
233 typedef SkipListSet< rcu_gpi, key_val, traits_SkipListSet_less_xorshift24 > SkipListSet_rcu_gpi_less_xorshift24;
234 typedef SkipListSet< rcu_gpb, key_val, traits_SkipListSet_less_xorshift24 > SkipListSet_rcu_gpb_less_xorshift24;
235 typedef SkipListSet< rcu_gpt, key_val, traits_SkipListSet_less_xorshift24 > SkipListSet_rcu_gpt_less_xorshift24;
236 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
237 typedef SkipListSet< rcu_shb, key_val, traits_SkipListSet_less_xorshift24 > SkipListSet_rcu_shb_less_xorshift24;
240 class traits_SkipListSet_less_xorshift16: public cc::skip_list::make_traits <
242 , cc::skip_list::random_level_generator< cc::skip_list::xorshift16 >
243 , co::item_counter< cds::atomicity::item_counter >
246 typedef SkipListSet< cds::gc::HP, key_val, traits_SkipListSet_less_xorshift16 > SkipListSet_hp_less_xorshift16;
247 typedef SkipListSet< cds::gc::DHP, key_val, traits_SkipListSet_less_xorshift16 > SkipListSet_dhp_less_xorshift16;
248 typedef SkipListSet< rcu_gpi, key_val, traits_SkipListSet_less_xorshift16 > SkipListSet_rcu_gpi_less_xorshift16;
249 typedef SkipListSet< rcu_gpb, key_val, traits_SkipListSet_less_xorshift16 > SkipListSet_rcu_gpb_less_xorshift16;
250 typedef SkipListSet< rcu_gpt, key_val, traits_SkipListSet_less_xorshift16 > SkipListSet_rcu_gpt_less_xorshift16;
251 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
252 typedef SkipListSet< rcu_shb, key_val, traits_SkipListSet_less_xorshift16 > SkipListSet_rcu_shb_less_xorshift16;
255 class traits_SkipListSet_less_xorshift32_stat: public cc::skip_list::make_traits <
257 ,cc::skip_list::random_level_generator< cc::skip_list::xorshift32 >
258 ,co::stat< cc::skip_list::stat<> >
259 ,co::item_counter< cds::atomicity::item_counter >
262 typedef SkipListSet< cds::gc::HP, key_val, traits_SkipListSet_less_xorshift32_stat > SkipListSet_hp_less_xorshift32_stat;
263 typedef SkipListSet< cds::gc::DHP, key_val, traits_SkipListSet_less_xorshift32_stat > SkipListSet_dhp_less_xorshift32_stat;
264 typedef SkipListSet< rcu_gpi, key_val, traits_SkipListSet_less_xorshift32_stat > SkipListSet_rcu_gpi_less_xorshift32_stat;
265 typedef SkipListSet< rcu_gpb, key_val, traits_SkipListSet_less_xorshift32_stat > SkipListSet_rcu_gpb_less_xorshift32_stat;
266 typedef SkipListSet< rcu_gpt, key_val, traits_SkipListSet_less_xorshift32_stat > SkipListSet_rcu_gpt_less_xorshift32_stat;
267 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
268 typedef SkipListSet< rcu_shb, key_val, traits_SkipListSet_less_xorshift32_stat > SkipListSet_rcu_shb_less_xorshift32_stat;
271 class traits_SkipListSet_less_xorshift24_stat: public cc::skip_list::make_traits <
273 , cc::skip_list::random_level_generator< cc::skip_list::xorshift24 >
274 , co::stat< cc::skip_list::stat<> >
275 , co::item_counter< cds::atomicity::item_counter >
278 typedef SkipListSet< cds::gc::HP, key_val, traits_SkipListSet_less_xorshift24_stat > SkipListSet_hp_less_xorshift24_stat;
279 typedef SkipListSet< cds::gc::DHP, key_val, traits_SkipListSet_less_xorshift24_stat > SkipListSet_dhp_less_xorshift24_stat;
280 typedef SkipListSet< rcu_gpi, key_val, traits_SkipListSet_less_xorshift24_stat > SkipListSet_rcu_gpi_less_xorshift24_stat;
281 typedef SkipListSet< rcu_gpb, key_val, traits_SkipListSet_less_xorshift24_stat > SkipListSet_rcu_gpb_less_xorshift24_stat;
282 typedef SkipListSet< rcu_gpt, key_val, traits_SkipListSet_less_xorshift24_stat > SkipListSet_rcu_gpt_less_xorshift24_stat;
283 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
284 typedef SkipListSet< rcu_shb, key_val, traits_SkipListSet_less_xorshift24_stat > SkipListSet_rcu_shb_less_xorshift24_stat;
287 class traits_SkipListSet_less_xorshift16_stat: public cc::skip_list::make_traits <
289 , cc::skip_list::random_level_generator< cc::skip_list::xorshift16 >
290 , co::stat< cc::skip_list::stat<> >
291 , co::item_counter< cds::atomicity::item_counter >
294 typedef SkipListSet< cds::gc::HP, key_val, traits_SkipListSet_less_xorshift16_stat > SkipListSet_hp_less_xorshift16_stat;
295 typedef SkipListSet< cds::gc::DHP, key_val, traits_SkipListSet_less_xorshift16_stat > SkipListSet_dhp_less_xorshift16_stat;
296 typedef SkipListSet< rcu_gpi, key_val, traits_SkipListSet_less_xorshift16_stat > SkipListSet_rcu_gpi_less_xorshift16_stat;
297 typedef SkipListSet< rcu_gpb, key_val, traits_SkipListSet_less_xorshift16_stat > SkipListSet_rcu_gpb_less_xorshift16_stat;
298 typedef SkipListSet< rcu_gpt, key_val, traits_SkipListSet_less_xorshift16_stat > SkipListSet_rcu_gpt_less_xorshift16_stat;
299 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
300 typedef SkipListSet< rcu_shb, key_val, traits_SkipListSet_less_xorshift16_stat > SkipListSet_rcu_shb_less_xorshift16_stat;
303 class traits_SkipListSet_cmp_xorshift32: public cc::skip_list::make_traits <
304 co::compare< compare >
305 ,cc::skip_list::random_level_generator< cc::skip_list::xorshift32 >
306 ,co::item_counter< cds::atomicity::item_counter >
309 typedef SkipListSet< cds::gc::HP, key_val, traits_SkipListSet_cmp_xorshift32 > SkipListSet_hp_cmp_xorshift32;
310 typedef SkipListSet< cds::gc::DHP, key_val, traits_SkipListSet_cmp_xorshift32 > SkipListSet_dhp_cmp_xorshift32;
311 typedef SkipListSet< rcu_gpi, key_val, traits_SkipListSet_cmp_xorshift32 > SkipListSet_rcu_gpi_cmp_xorshift32;
312 typedef SkipListSet< rcu_gpb, key_val, traits_SkipListSet_cmp_xorshift32 > SkipListSet_rcu_gpb_cmp_xorshift32;
313 typedef SkipListSet< rcu_gpt, key_val, traits_SkipListSet_cmp_xorshift32 > SkipListSet_rcu_gpt_cmp_xorshift32;
314 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
315 typedef SkipListSet< rcu_shb, key_val, traits_SkipListSet_cmp_xorshift32 > SkipListSet_rcu_shb_cmp_xorshift32;
318 class traits_SkipListSet_cmp_xorshift32_stat: public cc::skip_list::make_traits <
319 co::compare< compare >
320 ,cc::skip_list::random_level_generator< cc::skip_list::xorshift32 >
321 ,co::stat< cc::skip_list::stat<> >
322 ,co::item_counter< cds::atomicity::item_counter >
325 typedef SkipListSet< cds::gc::HP, key_val, traits_SkipListSet_cmp_xorshift32_stat > SkipListSet_hp_cmp_xorshift32_stat;
326 typedef SkipListSet< cds::gc::DHP, key_val, traits_SkipListSet_cmp_xorshift32_stat > SkipListSet_dhp_cmp_xorshift32_stat;
327 typedef SkipListSet< rcu_gpi, key_val, traits_SkipListSet_cmp_xorshift32_stat > SkipListSet_rcu_gpi_cmp_xorshift32_stat;
328 typedef SkipListSet< rcu_gpb, key_val, traits_SkipListSet_cmp_xorshift32_stat > SkipListSet_rcu_gpb_cmp_xorshift32_stat;
329 typedef SkipListSet< rcu_gpt, key_val, traits_SkipListSet_cmp_xorshift32_stat > SkipListSet_rcu_gpt_cmp_xorshift32_stat;
330 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
331 typedef SkipListSet< rcu_shb, key_val, traits_SkipListSet_cmp_xorshift32_stat > SkipListSet_rcu_shb_cmp_xorshift32_stat;
335 template <typename GC, typename T, typename Traits>
336 static inline void print_stat( cds_test::property_stream& o, SkipListSet<GC, T, Traits> const& s )
343 #define CDSSTRESS_SkipListSet_case( fixture, test_case, skiplist_set_type, key_type, value_type ) \
344 TEST_F( fixture, skiplist_set_type ) \
346 typedef set::set_type< tag_SkipListSet, key_type, value_type >::skiplist_set_type set_type; \
347 test_case<set_type>(); \
350 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
352 #if defined(CDS_STRESS_TEST_LEVEL) && CDS_STRESS_TEST_LEVEL > 1
353 # define CDSSTRESS_SkipListSet_SHRCU_2( fixture, test_case, key_type, value_type ) \
354 CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_shb_less_turbo32_seqcst, key_type, value_type) \
357 # define CDSSTRESS_SkipListSet_SHRCU_2( fixture, test_case, key_type, value_type )
360 #if defined(CDS_STRESS_TEST_LEVEL) && CDS_STRESS_TEST_LEVEL == 1
361 # define CDSSTRESS_SkipListSet_SHRCU_1( fixture, test_case, key_type, value_type ) \
362 CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_shb_less_turbo32_stat, key_type, value_type) \
363 CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_shb_cmp_turbo32, key_type, value_type) \
364 CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_shb_less_xorshift32_stat, key_type, value_type) \
365 CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_shb_cmp_xorshift32_stat, key_type, value_type) \
368 # define CDSSTRESS_SkipListSet_SHRCU_1( fixture, test_case, key_type, value_type )
372 # define CDSSTRESS_SkipListSet_SHRCU( fixture, test_case, key_type, value_type ) \
373 CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_shb_less_turbo32, key_type, value_type) \
374 CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_shb_cmp_turbo32_stat, key_type, value_type) \
375 CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_shb_less_xorshift32, key_type, value_type) \
376 CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_shb_cmp_xorshift32, key_type, value_type) \
377 CDSSTRESS_SkipListSet_SHRCU_1( fixture, test_case, key_type, value_type ) \
378 CDSSTRESS_SkipListSet_SHRCU_2( fixture, test_case, key_type, value_type ) \
381 # define CDSSTRESS_SkipListSet_SHRCU( fixture, test_case, key_type, value_type )
384 #if defined(CDS_STRESS_TEST_LEVEL) && CDS_STRESS_TEST_LEVEL > 1
385 # define CDSSTRESS_SkipListSet_HP_2( fixture, test_case, key_type, value_type ) \
386 CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_hp_less_turbo32_seqcst, key_type, value_type ) \
387 CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_dhp_less_turbo32_seqcst, key_type, value_type ) \
389 # define CDSSTRESS_SkipListSet_RCU_2( fixture, test_case, key_type, value_type ) \
390 CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_gpi_less_turbo32_seqcst, key_type, value_type ) \
391 CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_gpb_less_turbo32_seqcst, key_type, value_type ) \
392 CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_gpt_less_turbo32_seqcst, key_type, value_type ) \
395 # define CDSSTRESS_SkipListSet_HP_2( fixture, test_case, key_type, value_type )
396 # define CDSSTRESS_SkipListSet_RCU_2( fixture, test_case, key_type, value_type )
399 #if defined(CDS_STRESS_TEST_LEVEL) && CDS_STRESS_TEST_LEVEL == 1
400 # define CDSSTRESS_SkipListSet_HP_1( fixture, test_case, key_type, value_type ) \
401 CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_dhp_less_turbo32, key_type, value_type ) \
402 CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_hp_less_turbo32_stat, key_type, value_type ) \
403 CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_hp_cmp_turbo32, key_type, value_type ) \
404 CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_dhp_cmp_turbo32_stat, key_type, value_type ) \
405 CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_dhp_less_xorshift32, key_type, value_type ) \
406 CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_hp_less_xorshift32_stat, key_type, value_type ) \
407 CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_hp_cmp_xorshift32, key_type, value_type ) \
408 CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_dhp_cmp_xorshift32_stat, key_type, value_type ) \
410 # define CDSSTRESS_SkipListSet_RCU_1( fixture, test_case, key_type, value_type ) \
411 CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_gpb_less_turbo32, key_type, value_type ) \
412 CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_gpi_less_turbo32_stat, key_type, value_type ) \
413 CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_gpt_less_turbo32_stat, key_type, value_type ) \
414 CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_gpi_cmp_turbo32, key_type, value_type ) \
415 CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_gpt_cmp_turbo32, key_type, value_type ) \
416 CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_gpb_cmp_turbo32_stat, key_type, value_type ) \
417 CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_gpb_less_xorshift32, key_type, value_type ) \
418 CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_gpi_less_xorshift32_stat, key_type, value_type ) \
419 CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_gpt_less_xorshift32_stat, key_type, value_type ) \
420 CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_gpi_cmp_xorshift32, key_type, value_type ) \
421 CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_gpt_cmp_xorshift32, key_type, value_type ) \
422 CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_gpb_cmp_xorshift32_stat, key_type, value_type ) \
423 CDSSTRESS_SkipListSet_SHRCU( fixture, test_case, key_type, value_type ) \
426 # define CDSSTRESS_SkipListSet_HP_1( fixture, test_case, key_type, value_type )
427 # define CDSSTRESS_SkipListSet_RCU_1( fixture, test_case, key_type, value_type )
431 #define CDSSTRESS_SkipListSet_HP( fixture, test_case, key_type, value_type ) \
432 CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_hp_less_turbo32, key_type, value_type ) \
433 CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_hp_less_turbo24, key_type, value_type ) \
434 CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_hp_less_turbo16, key_type, value_type ) \
435 CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_dhp_less_turbo32_stat, key_type, value_type ) \
436 CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_dhp_less_turbo24_stat, key_type, value_type ) \
437 CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_dhp_less_turbo16_stat, key_type, value_type ) \
438 CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_dhp_cmp_turbo32, key_type, value_type ) \
439 CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_hp_cmp_turbo32_stat, key_type, value_type ) \
440 CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_hp_less_xorshift32, key_type, value_type ) \
441 CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_hp_less_xorshift24, key_type, value_type ) \
442 CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_hp_less_xorshift16, key_type, value_type ) \
443 CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_dhp_less_xorshift32_stat, key_type, value_type ) \
444 CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_dhp_less_xorshift24_stat, key_type, value_type ) \
445 CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_dhp_less_xorshift16_stat, key_type, value_type ) \
446 CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_dhp_cmp_xorshift32, key_type, value_type ) \
447 CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_hp_cmp_xorshift32_stat, key_type, value_type ) \
448 CDSSTRESS_SkipListSet_HP_1( fixture, test_case, key_type, value_type ) \
449 CDSSTRESS_SkipListSet_HP_2( fixture, test_case, key_type, value_type ) \
451 #define CDSSTRESS_SkipListSet_RCU( fixture, test_case, key_type, value_type ) \
452 CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_gpi_less_turbo32, key_type, value_type ) \
453 CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_gpt_less_turbo32, key_type, value_type ) \
454 CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_gpb_less_turbo32_stat, key_type, value_type ) \
455 CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_gpb_less_turbo24_stat, key_type, value_type ) \
456 CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_gpb_less_turbo16_stat, key_type, value_type ) \
457 CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_gpb_cmp_turbo32, key_type, value_type ) \
458 CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_gpi_cmp_turbo32_stat, key_type, value_type ) \
459 CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_gpt_cmp_turbo32_stat, key_type, value_type ) \
460 CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_gpi_less_xorshift32, key_type, value_type ) \
461 CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_gpt_less_xorshift32, key_type, value_type ) \
462 CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_gpb_less_xorshift32_stat, key_type, value_type ) \
463 CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_gpb_less_xorshift24_stat, key_type, value_type ) \
464 CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_gpb_less_xorshift16_stat, key_type, value_type ) \
465 CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_gpb_cmp_xorshift32, key_type, value_type ) \
466 CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_gpi_cmp_xorshift32_stat, key_type, value_type ) \
467 CDSSTRESS_SkipListSet_case( fixture, test_case, SkipListSet_rcu_gpt_cmp_xorshift32_stat, key_type, value_type ) \
468 CDSSTRESS_SkipListSet_RCU_1( fixture, test_case, key_type, value_type ) \
469 CDSSTRESS_SkipListSet_RCU_2( fixture, test_case, key_type, value_type ) \
471 #define CDSSTRESS_SkipListSet( fixture, test_case, key_type, value_type ) \
472 CDSSTRESS_SkipListSet_HP( fixture, test_case, key_type, value_type ) \
473 CDSSTRESS_SkipListSet_RCU( fixture, test_case, key_type, value_type ) \
475 #endif // #ifndef CDSUNIT_SET_TYPE_SKIP_LIST_H