formatting
[libcds.git] / test / stress / set / set_type_skip_list.h
1 /*
2     This file is a part of libcds - Concurrent Data Structures library
3
4     (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2017
5
6     Source code repo: http://github.com/khizmax/libcds/
7     Download: http://sourceforge.net/projects/libcds/files/
8
9     Redistribution and use in source and binary forms, with or without
10     modification, are permitted provided that the following conditions are met:
11
12     * Redistributions of source code must retain the above copyright notice, this
13       list of conditions and the following disclaimer.
14
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.
18
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.
29 */
30
31 #ifndef CDSUNIT_SET_TYPE_SKIP_LIST_H
32 #define CDSUNIT_SET_TYPE_SKIP_LIST_H
33
34 #include "set_type.h"
35
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>
39
40 #include <cds_test/stat_skiplist_out.h>
41
42 namespace set {
43
44     template <typename GC, typename T, typename Traits = cc::skip_list::traits >
45     class SkipListSet : public cc::SkipListSet<GC, T, Traits>
46     {
47         typedef cc::SkipListSet<GC, T, Traits> base_class;
48     public:
49         template <typename Config>
50         SkipListSet( Config const& /*cfg*/ )
51         {}
52
53         // for testing
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;
57     };
58
59     struct tag_SkipListSet;
60
61     template <typename Key, typename Val>
62     struct set_type< tag_SkipListSet, Key, Val >: public set_type_base< Key, Val >
63     {
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;
69
70         class traits_SkipListSet_less_turbo32: public cc::skip_list::make_traits <
71                 co::less< less >
72                 ,cc::skip_list::random_level_generator< cc::skip_list::turbo32 >
73                 ,co::item_counter< cds::atomicity::cache_friendly_item_counter >
74             >::type
75         {};
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;
83 #endif
84
85         class traits_SkipListSet_less_turbo24: public cc::skip_list::make_traits <
86                 co::less< less >
87                 ,cc::skip_list::random_level_generator< cc::skip_list::turbo24 >
88                 ,co::item_counter< cds::atomicity::cache_friendly_item_counter >
89             >::type
90         {};
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;
98 #endif
99
100         class traits_SkipListSet_less_turbo16: public cc::skip_list::make_traits <
101                 co::less< less >
102                 ,cc::skip_list::random_level_generator< cc::skip_list::turbo16 >
103                 ,co::item_counter< cds::atomicity::cache_friendly_item_counter >
104             >::type
105         {};
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;
113 #endif
114
115         class traits_SkipListSet_less_turbo32_seqcst: public cc::skip_list::make_traits <
116                 co::less< less >
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::cache_friendly_item_counter >
120             >::type
121         {};
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;
129 #endif
130
131         class traits_SkipListSet_less_turbo32_stat: public cc::skip_list::make_traits <
132                 co::less< less >
133                 ,cc::skip_list::random_level_generator< cc::skip_list::turbo32 >
134                 ,co::stat< cc::skip_list::stat<> >
135                 ,co::item_counter< cds::atomicity::cache_friendly_item_counter >
136             >::type
137         {};
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;
145 #endif
146
147         class traits_SkipListSet_less_turbo24_stat: public cc::skip_list::make_traits <
148                 co::less< less >
149                 ,cc::skip_list::random_level_generator< cc::skip_list::turbo24 >
150                 ,co::stat< cc::skip_list::stat<> >
151                 ,co::item_counter< cds::atomicity::cache_friendly_item_counter >
152             >::type
153         {};
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;
161 #endif
162
163         class traits_SkipListSet_less_turbo16_stat: public cc::skip_list::make_traits <
164                 co::less< less >
165                 ,cc::skip_list::random_level_generator< cc::skip_list::turbo16 >
166                 ,co::stat< cc::skip_list::stat<> >
167                 ,co::item_counter< cds::atomicity::cache_friendly_item_counter >
168             >::type
169         {};
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;
177 #endif
178
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::cache_friendly_item_counter >
183         >::type
184         {};
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;
192 #endif
193
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::cache_friendly_item_counter >
199         >::type
200         {};
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;
208 #endif
209
210         class traits_SkipListSet_less_xorshift32: public cc::skip_list::make_traits <
211             co::less< less >
212             ,cc::skip_list::random_level_generator< cc::skip_list::xorshift32 >
213             ,co::item_counter< cds::atomicity::cache_friendly_item_counter >
214         >::type
215         {};
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;
223 #endif
224
225         class traits_SkipListSet_less_xorshift24: public cc::skip_list::make_traits <
226             co::less< less >
227             ,cc::skip_list::random_level_generator< cc::skip_list::xorshift24 >
228             ,co::item_counter< cds::atomicity::cache_friendly_item_counter >
229         >::type
230         {};
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;
238 #endif
239
240         class traits_SkipListSet_less_xorshift16: public cc::skip_list::make_traits <
241             co::less< less >
242             , cc::skip_list::random_level_generator< cc::skip_list::xorshift16 >
243             , co::item_counter< cds::atomicity::cache_friendly_item_counter >
244         >::type
245         {};
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;
253 #endif
254
255         class traits_SkipListSet_less_xorshift32_stat: public cc::skip_list::make_traits <
256             co::less< less >
257             ,cc::skip_list::random_level_generator< cc::skip_list::xorshift32 >
258             ,co::stat< cc::skip_list::stat<> >
259             ,co::item_counter< cds::atomicity::cache_friendly_item_counter >
260         >::type
261         {};
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;
269 #endif
270
271         class traits_SkipListSet_less_xorshift24_stat: public cc::skip_list::make_traits <
272             co::less< less >
273             , cc::skip_list::random_level_generator< cc::skip_list::xorshift24 >
274             , co::stat< cc::skip_list::stat<> >
275             , co::item_counter< cds::atomicity::cache_friendly_item_counter >
276         >::type
277         {};
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;
285 #endif
286
287         class traits_SkipListSet_less_xorshift16_stat: public cc::skip_list::make_traits <
288             co::less< less >
289             , cc::skip_list::random_level_generator< cc::skip_list::xorshift16 >
290             , co::stat< cc::skip_list::stat<> >
291             , co::item_counter< cds::atomicity::cache_friendly_item_counter >
292         >::type
293         {};
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;
301 #endif
302
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::cache_friendly_item_counter >
307         >::type
308         {};
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;
316 #endif
317
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::cache_friendly_item_counter >
323         >::type
324         {};
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;
332 #endif
333     };
334
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 )
337     {
338         o << s.statistics();
339     }
340
341 } // namespace set
342
343 #define CDSSTRESS_SkipListSet_case( fixture, test_case, skiplist_set_type, key_type, value_type ) \
344     TEST_F( fixture, skiplist_set_type ) \
345     { \
346         typedef set::set_type< tag_SkipListSet, key_type, value_type >::skiplist_set_type set_type; \
347         test_case<set_type>(); \
348     }
349
350 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
351
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) \
355
356 #else
357 #   define CDSSTRESS_SkipListSet_SHRCU_2( fixture, test_case, key_type, value_type )
358 #endif
359
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) \
366
367 #else
368 #   define CDSSTRESS_SkipListSet_SHRCU_1( fixture, test_case, key_type, value_type )
369 #endif
370
371
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 ) \
379
380 #else
381 #   define CDSSTRESS_SkipListSet_SHRCU( fixture, test_case, key_type, value_type )
382 #endif
383
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 ) \
388
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 ) \
393
394 #else
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 )
397 #endif
398
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 ) \
409
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 ) \
424
425 #else
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 )
428 #endif
429
430
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 ) \
450
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 ) \
470
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 ) \
474
475 #endif // #ifndef CDSUNIT_SET_TYPE_SKIP_LIST_H