Merged branch 'master' of https://github.com/Nemo1369/libcds
[libcds.git] / test / stress / stack / stack_type.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 CDSSTRESS_STACK_TYPES_H
32 #define CDSSTRESS_STACK_TYPES_H
33
34 #include <cds/container/treiber_stack.h>
35 #include <cds/container/fcstack.h>
36 #include <cds/container/fcdeque.h>
37
38 #include <cds/gc/hp.h>
39 #include <cds/gc/dhp.h>
40
41 #include <mutex>
42 #include <cds/sync/spinlock.h>
43 #include <stack>
44 #include <list>
45 #include <vector>
46
47 #include <cds_test/stress_test.h>
48 #include <cds_test/stat_flat_combining_out.h>
49
50 namespace stack {
51
52     namespace details {
53
54         template <typename T, typename Traits=cds::container::fcdeque::traits>
55         class FCDequeL: public cds::container::FCDeque<T, std::deque<T>, Traits >
56         {
57             typedef cds::container::FCDeque<T, std::deque<T>, Traits > base_class;
58         public:
59             FCDequeL()
60             {}
61
62             FCDequeL(
63                 unsigned int nCompactFactor     ///< Flat combining: publication list compacting factor
64                 ,unsigned int nCombinePassCount ///< Flat combining: number of combining passes for combiner thread
65                 )
66                 : base_class( nCompactFactor, nCombinePassCount )
67             {}
68
69             bool push( T const& v )
70             {
71                 return base_class::push_front( v );
72             }
73
74             bool pop( T& v )
75             {
76                 return base_class::pop_front( v );
77             }
78         };
79
80         template <typename T, typename Traits=cds::container::fcdeque::traits>
81         class FCDequeR: public cds::container::FCDeque<T, std::deque<T>, Traits >
82         {
83             typedef cds::container::FCDeque<T, std::deque<T>, Traits > base_class;
84         public:
85             FCDequeR()
86             {}
87
88             FCDequeR(
89                 unsigned int nCompactFactor     ///< Flat combining: publication list compacting factor
90                 ,unsigned int nCombinePassCount ///< Flat combining: number of combining passes for combiner thread
91                 )
92                 : base_class( nCompactFactor, nCombinePassCount )
93             {}
94
95             bool push( T const& v )
96             {
97                 return base_class::push_back( v );
98             }
99
100             bool pop( T& v )
101             {
102                 return base_class::pop_back( v );
103             }
104         };
105
106         template < typename T, typename Stack, typename Lock>
107         class StdStack
108         {
109             Stack   m_Impl;
110             mutable Lock    m_Lock;
111             cds::container::treiber_stack::empty_stat m_stat;
112
113             typedef std::unique_lock<Lock>  unique_lock;
114
115         public:
116             bool push( T const& v )
117             {
118                 unique_lock l( m_Lock );
119                 m_Impl.push( v );
120                 return true;
121             }
122
123             bool pop( T& v )
124             {
125                 unique_lock l( m_Lock );
126                 if ( !m_Impl.empty()) {
127                     v = m_Impl.top();
128                     m_Impl.pop();
129                     return true;
130                 }
131                 return false;
132             }
133
134             bool empty() const
135             {
136                 unique_lock l( m_Lock );
137                 return m_Impl.empty();
138             }
139
140             cds::container::treiber_stack::empty_stat const& statistics() const
141             {
142                 return m_stat;
143             }
144         };
145     }
146
147     template <typename T>
148     struct Types {
149
150     // TreiberStack
151         typedef cds::container::TreiberStack< cds::gc::HP,  T > Treiber_HP;
152         typedef cds::container::TreiberStack< cds::gc::DHP, T > Treiber_DHP;
153
154         struct traits_Treiber_seqcst: public
155             cds::container::treiber_stack::make_traits<
156                 cds::opt::memory_model<cds::opt::v::sequential_consistent>
157             >::type
158         {};
159         typedef cds::container::TreiberStack< cds::gc::HP,  T, traits_Treiber_seqcst > Treiber_HP_seqcst;
160         typedef cds::container::TreiberStack< cds::gc::DHP, T, traits_Treiber_seqcst > Treiber_DHP_seqcst;
161
162         struct traits_Treiber_stat: public
163             cds::container::treiber_stack::make_traits<
164                 cds::opt::stat<cds::intrusive::treiber_stack::stat<> >
165             >::type
166         {};
167         typedef cds::container::TreiberStack< cds::gc::HP, T, traits_Treiber_stat > Treiber_HP_stat;
168         typedef cds::container::TreiberStack< cds::gc::DHP, T, traits_Treiber_stat > Treiber_DHP_stat;
169
170         struct traits_Treiber_yield: public
171             cds::container::treiber_stack::make_traits<
172                 cds::opt::back_off<cds::backoff::yield>
173                 , cds::opt::memory_model<cds::opt::v::relaxed_ordering>
174             >::type
175         {};
176         typedef cds::container::TreiberStack< cds::gc::HP,  T, traits_Treiber_yield > Treiber_HP_yield;
177         typedef cds::container::TreiberStack< cds::gc::DHP, T, traits_Treiber_yield > Treiber_DHP_yield;
178
179         struct traits_Treiber_pause: public
180             cds::container::treiber_stack::make_traits<
181                 cds::opt::back_off<cds::backoff::pause>
182             >::type
183         {};
184         typedef cds::container::TreiberStack< cds::gc::HP,  T, traits_Treiber_pause > Treiber_HP_pause;
185         typedef cds::container::TreiberStack< cds::gc::DHP, T, traits_Treiber_pause > Treiber_DHP_pause;
186
187         struct traits_Treiber_exp: public
188             cds::container::treiber_stack::make_traits<
189                 cds::opt::back_off<
190                     cds::backoff::exponential<
191                         cds::backoff::pause,
192                         cds::backoff::yield
193                     >
194                 >
195             >::type
196         {};
197         typedef cds::container::TreiberStack< cds::gc::HP,  T, traits_Treiber_exp > Treiber_HP_exp;
198         typedef cds::container::TreiberStack< cds::gc::DHP, T, traits_Treiber_exp > Treiber_DHP_exp;
199
200
201     // Elimination stack
202         struct traits_Elimination_on : public
203             cds::container::treiber_stack::make_traits <
204                 cds::opt::enable_elimination<true>
205             > ::type
206         {};
207         typedef cds::container::TreiberStack< cds::gc::HP,  T, traits_Elimination_on > Elimination_HP;
208         typedef cds::container::TreiberStack< cds::gc::DHP, T, traits_Elimination_on > Elimination_DHP;
209
210         struct traits_Elimination_stat : public
211             cds::container::treiber_stack::make_traits <
212                 cds::opt::enable_elimination<true>
213                 ,cds::opt::stat<cds::intrusive::treiber_stack::stat<> >
214             > ::type
215         {};
216         typedef cds::container::TreiberStack< cds::gc::HP,  T, traits_Elimination_stat > Elimination_HP_stat;
217         typedef cds::container::TreiberStack< cds::gc::DHP, T, traits_Elimination_stat > Elimination_DHP_stat;
218
219         struct traits_Elimination_2ms: public
220             cds::container::treiber_stack::make_traits <
221                 cds::opt::enable_elimination<true>
222                 ,cds::opt::elimination_backoff< cds::backoff::delay_of<2> >
223             > ::type
224         {};
225         typedef cds::container::TreiberStack< cds::gc::HP,  T, traits_Elimination_2ms >  Elimination_HP_2ms;
226         typedef cds::container::TreiberStack< cds::gc::DHP, T, traits_Elimination_2ms >  Elimination_DHP_2ms;
227
228         struct traits_Elimination_2ms_stat : public
229             cds::container::treiber_stack::make_traits <
230                 cds::opt::enable_elimination<true>
231                 , cds::opt::elimination_backoff< cds::backoff::delay_of<2> >
232                 , cds::opt::stat<cds::intrusive::treiber_stack::stat<> >
233             > ::type
234         {};
235         typedef cds::container::TreiberStack< cds::gc::HP,  T, traits_Elimination_2ms_stat > Elimination_HP_2ms_stat;
236         typedef cds::container::TreiberStack< cds::gc::DHP, T, traits_Elimination_2ms_stat > Elimination_DHP_2ms_stat;
237
238         struct traits_Elimination_5ms : public
239             cds::container::treiber_stack::make_traits <
240                 cds::opt::enable_elimination<true>
241                 , cds::opt::elimination_backoff< cds::backoff::delay_of<5> >
242             > ::type
243         {};
244         typedef cds::container::TreiberStack< cds::gc::HP,  T, traits_Elimination_5ms > Elimination_HP_5ms;
245         typedef cds::container::TreiberStack< cds::gc::DHP, T, traits_Elimination_5ms > Elimination_DHP_5ms;
246
247         struct traits_Elimination_5ms_stat : public
248             cds::container::treiber_stack::make_traits <
249                 cds::opt::enable_elimination<true>
250                 , cds::opt::elimination_backoff< cds::backoff::delay_of<5> >
251                 , cds::opt::stat<cds::intrusive::treiber_stack::stat<> >
252             > ::type
253         {};
254         typedef cds::container::TreiberStack< cds::gc::HP,  T, traits_Elimination_5ms_stat > Elimination_HP_5ms_stat;
255         typedef cds::container::TreiberStack< cds::gc::DHP, T, traits_Elimination_5ms_stat > Elimination_DHP_5ms_stat;
256
257         struct traits_Elimination_10ms : public
258             cds::container::treiber_stack::make_traits <
259                 cds::opt::enable_elimination<true>
260                 , cds::opt::elimination_backoff< cds::backoff::delay_of<10> >
261             > ::type
262         {};
263         typedef cds::container::TreiberStack< cds::gc::HP,  T, traits_Elimination_10ms > Elimination_HP_10ms;
264         typedef cds::container::TreiberStack< cds::gc::DHP, T, traits_Elimination_10ms > Elimination_DHP_10ms;
265
266         struct traits_Elimination_10ms_stat : public
267             cds::container::treiber_stack::make_traits <
268                 cds::opt::enable_elimination<true>
269                 , cds::opt::elimination_backoff< cds::backoff::delay_of<10> >
270                 , cds::opt::stat<cds::intrusive::treiber_stack::stat<> >
271             > ::type
272         {};
273         typedef cds::container::TreiberStack< cds::gc::HP,  T, traits_Elimination_10ms_stat > Elimination_HP_10ms_stat;
274         typedef cds::container::TreiberStack< cds::gc::DHP, T, traits_Elimination_10ms_stat > Elimination_DHP_10ms_stat;
275
276         struct traits_Elimination_dyn: public
277             cds::container::treiber_stack::make_traits <
278                 cds::opt::enable_elimination<true>
279                 , cds::opt::buffer< cds::opt::v::initialized_dynamic_buffer<int> >
280             > ::type
281         {};
282         typedef cds::container::TreiberStack< cds::gc::HP,  T, traits_Elimination_dyn > Elimination_HP_dyn;
283         typedef cds::container::TreiberStack< cds::gc::DHP, T, traits_Elimination_dyn > Elimination_DHP_dyn;
284
285         struct traits_Elimination_seqcst: public
286             cds::container::treiber_stack::make_traits <
287                 cds::opt::enable_elimination<true>
288                 , cds::opt::memory_model<cds::opt::v::sequential_consistent>
289             > ::type
290         {};
291         typedef cds::container::TreiberStack< cds::gc::HP,  T, traits_Elimination_seqcst > Elimination_HP_seqcst;
292         typedef cds::container::TreiberStack< cds::gc::DHP, T, traits_Elimination_seqcst > Elimination_DHP_seqcst;
293
294         struct traits_Elimination_dyn_stat: public
295             cds::container::treiber_stack::make_traits <
296                 cds::opt::enable_elimination<true>
297                 , cds::opt::stat<cds::intrusive::treiber_stack::stat<> >
298                 , cds::opt::buffer< cds::opt::v::initialized_dynamic_buffer<int> >
299             > ::type
300         {};
301         typedef cds::container::TreiberStack< cds::gc::HP,  T, traits_Elimination_dyn_stat > Elimination_HP_dyn_stat;
302         typedef cds::container::TreiberStack< cds::gc::DHP, T, traits_Elimination_dyn_stat > Elimination_DHP_dyn_stat;
303
304         struct traits_Elimination_yield: public
305             cds::container::treiber_stack::make_traits <
306                 cds::opt::enable_elimination<true>
307                 , cds::opt::back_off<cds::backoff::yield>
308                 , cds::opt::memory_model<cds::opt::v::relaxed_ordering>
309             > ::type
310         {};
311         typedef cds::container::TreiberStack< cds::gc::HP,  T, traits_Elimination_yield > Elimination_HP_yield;
312         typedef cds::container::TreiberStack< cds::gc::DHP, T, traits_Elimination_yield > Elimination_DHP_yield;
313
314         struct traits_Elimination_pause: public
315             cds::container::treiber_stack::make_traits <
316                 cds::opt::enable_elimination<true>
317                 , cds::opt::back_off<cds::backoff::pause>
318             > ::type
319         {};
320         typedef cds::container::TreiberStack< cds::gc::HP,  T, traits_Elimination_pause > Elimination_HP_pause;
321         typedef cds::container::TreiberStack< cds::gc::DHP, T, traits_Elimination_pause > Elimination_DHP_pause;
322
323         struct traits_Elimination_exp: public
324             cds::container::treiber_stack::make_traits <
325                 cds::opt::enable_elimination<true>
326                 ,cds::opt::back_off<
327                     cds::backoff::exponential<
328                         cds::backoff::pause,
329                         cds::backoff::yield
330                     >
331                 >
332             > ::type
333         {};
334         typedef cds::container::TreiberStack< cds::gc::HP,  T, traits_Elimination_exp > Elimination_HP_exp;
335         typedef cds::container::TreiberStack< cds::gc::DHP, T, traits_Elimination_exp > Elimination_DHP_exp;
336
337
338     // FCStack
339         typedef cds::container::FCStack< T > FCStack_deque;
340
341         struct traits_FCStack_stat:
342             public cds::container::fcstack::make_traits<
343                 cds::opt::stat< cds::container::fcstack::stat<> >
344             >::type
345         {};
346         struct traits_FCStack_elimination:
347             public cds::container::fcstack::make_traits<
348             cds::opt::enable_elimination< true >
349             >::type
350         {};
351         struct traits_FCStack_elimination_stat:
352             public cds::container::fcstack::make_traits<
353                 cds::opt::stat< cds::container::fcstack::stat<> >,
354                 cds::opt::enable_elimination< true >
355             >::type
356         {};
357         struct traits_FCStack_mutex:
358             public cds::container::fcstack::make_traits<
359                 cds::opt::lock_type< std::mutex >
360             >::type
361         {};
362
363         typedef cds::container::FCStack< T, std::stack<T, std::deque<T> >, traits_FCStack_mutex > FCStack_deque_mutex;
364         typedef cds::container::FCStack< T, std::stack<T, std::deque<T> >, traits_FCStack_stat > FCStack_deque_stat;
365         typedef cds::container::FCStack< T, std::stack<T, std::deque<T> >, traits_FCStack_elimination > FCStack_deque_elimination;
366         typedef cds::container::FCStack< T, std::stack<T, std::deque<T> >, traits_FCStack_elimination_stat > FCStack_deque_elimination_stat;
367         typedef cds::container::FCStack< T, std::stack<T, std::vector<T> > > FCStack_vector;
368         typedef cds::container::FCStack< T, std::stack<T, std::vector<T> >, traits_FCStack_mutex > FCStack_vector_mutex;
369         typedef cds::container::FCStack< T, std::stack<T, std::vector<T> >, traits_FCStack_stat > FCStack_vector_stat;
370         typedef cds::container::FCStack< T, std::stack<T, std::vector<T> >, traits_FCStack_elimination > FCStack_vector_elimination;
371         typedef cds::container::FCStack< T, std::stack<T, std::vector<T> >, traits_FCStack_elimination_stat > FCStack_vector_elimination_stat;
372         typedef cds::container::FCStack< T, std::stack<T, std::list<T> > > FCStack_list;
373         typedef cds::container::FCStack< T, std::stack<T, std::list<T> >, traits_FCStack_mutex > FCStack_list_mutex;
374         typedef cds::container::FCStack< T, std::stack<T, std::list<T> >, traits_FCStack_stat > FCStack_list_stat;
375         typedef cds::container::FCStack< T, std::stack<T, std::list<T> >, traits_FCStack_elimination > FCStack_list_elimination;
376         typedef cds::container::FCStack< T, std::stack<T, std::list<T> >, traits_FCStack_elimination_stat > FCStack_list_elimination_stat;
377
378    // FCDeque
379         struct traits_FCDeque_stat:
380             public cds::container::fcdeque::make_traits<
381                 cds::opt::stat< cds::container::fcdeque::stat<> >
382             >::type
383         {};
384         struct traits_FCDeque_elimination:
385             public cds::container::fcdeque::make_traits<
386                 cds::opt::enable_elimination< true >
387             >::type
388         {};
389         struct traits_FCDeque_elimination_stat:
390             public cds::container::fcdeque::make_traits<
391                 cds::opt::stat< cds::container::fcdeque::stat<> >,
392                 cds::opt::enable_elimination< true >
393             >::type
394         {};
395         struct traits_FCDeque_mutex:
396             public cds::container::fcdeque::make_traits<
397                 cds::opt::lock_type< std::mutex >
398             >::type
399         {};
400
401
402         typedef details::FCDequeL< T > FCDequeL_default;
403         typedef details::FCDequeL< T, traits_FCDeque_mutex > FCDequeL_mutex;
404         typedef details::FCDequeL< T, traits_FCDeque_stat > FCDequeL_stat;
405         typedef details::FCDequeL< T, traits_FCDeque_elimination > FCDequeL_elimination;
406         typedef details::FCDequeL< T, traits_FCDeque_elimination_stat > FCDequeL_elimination_stat;
407
408         typedef details::FCDequeR< T > FCDequeR_default;
409         typedef details::FCDequeR< T, traits_FCDeque_mutex > FCDequeR_mutex;
410         typedef details::FCDequeR< T, traits_FCDeque_stat > FCDequeR_stat;
411         typedef details::FCDequeR< T, traits_FCDeque_elimination > FCDequeR_elimination;
412         typedef details::FCDequeR< T, traits_FCDeque_elimination_stat > FCDequeR_elimination_stat;
413
414
415         // std::stack
416         typedef details::StdStack< T, std::stack< T >, std::mutex >  StdStack_Deque_Mutex;
417         typedef details::StdStack< T, std::stack< T >, cds::sync::spin > StdStack_Deque_Spin;
418         typedef details::StdStack< T, std::stack< T, std::vector<T> >, std::mutex >  StdStack_Vector_Mutex;
419         typedef details::StdStack< T, std::stack< T, std::vector<T> >, cds::sync::spin > StdStack_Vector_Spin;
420         typedef details::StdStack< T, std::stack< T, std::list<T> >, std::mutex >  StdStack_List_Mutex;
421         typedef details::StdStack< T, std::stack< T, std::list<T> >, cds::sync::spin > StdStack_List_Spin;
422
423     };
424 } // namespace stack
425
426 namespace cds_test {
427     static inline property_stream& operator <<( property_stream& o, cds::container::treiber_stack::empty_stat const& )
428     {
429         return o;
430     }
431
432     static inline property_stream& operator <<( property_stream& o, cds::container::treiber_stack::stat<> const& s )
433     {
434         return o
435             << CDSSTRESS_STAT_OUT( s, m_PushCount )
436             << CDSSTRESS_STAT_OUT( s, m_PopCount  )
437             << CDSSTRESS_STAT_OUT( s, m_PushRace  )
438             << CDSSTRESS_STAT_OUT( s, m_PopRace   )
439             << CDSSTRESS_STAT_OUT( s, m_ActivePushCollision  )
440             << CDSSTRESS_STAT_OUT( s, m_PassivePopCollision  )
441             << CDSSTRESS_STAT_OUT( s, m_ActivePopCollision   )
442             << CDSSTRESS_STAT_OUT( s, m_PassivePushCollision )
443             << CDSSTRESS_STAT_OUT( s, m_EliminationFailed    );
444     }
445
446     static inline property_stream& operator <<( property_stream& o, cds::container::fcstack::empty_stat const& /*s*/ )
447     {
448         return o;
449     }
450
451     static inline property_stream& operator <<( property_stream& o, cds::container::fcstack::stat<> const& s )
452     {
453         return o
454             << CDSSTRESS_STAT_OUT( s, m_nPush )
455             << CDSSTRESS_STAT_OUT( s, m_nPushMove )
456             << CDSSTRESS_STAT_OUT( s, m_nPop )
457             << CDSSTRESS_STAT_OUT( s, m_nFailedPop )
458             << CDSSTRESS_STAT_OUT( s, m_nCollided )
459             << static_cast<cds::algo::flat_combining::stat<> const&>( s );
460     }
461
462     static inline property_stream& operator <<( property_stream& o, cds::container::fcdeque::empty_stat const& /*s*/ )
463     {
464         return o;
465     }
466
467     static inline property_stream& operator <<( property_stream& o, cds::container::fcdeque::stat<> const& s )
468     {
469         return o
470             << CDSSTRESS_STAT_OUT( s, m_nPushFront )
471             << CDSSTRESS_STAT_OUT( s, m_nPushFrontMove )
472             << CDSSTRESS_STAT_OUT( s, m_nPushBack )
473             << CDSSTRESS_STAT_OUT( s, m_nPushBackMove )
474             << CDSSTRESS_STAT_OUT( s, m_nPopFront )
475             << CDSSTRESS_STAT_OUT( s, m_nFailedPopFront )
476             << CDSSTRESS_STAT_OUT( s, m_nPopBack )
477             << CDSSTRESS_STAT_OUT( s, m_nFailedPopBack )
478             << CDSSTRESS_STAT_OUT( s, m_nCollided )
479             << static_cast<cds::algo::flat_combining::stat<> const&>(s);
480     }
481 } // namespace cds_test
482
483 #define CDSSTRESS_Stack_F( test_fixture, type_name ) \
484     TEST_F( test_fixture, type_name ) \
485     { \
486         typedef stack::Types< value_type >::type_name stack_type; \
487         stack_type stack; \
488         test( stack ); \
489     }
490
491 #define CDSSTRESS_EliminationStack_F( test_fixture, type_name ) \
492     TEST_F( test_fixture, type_name ) \
493     { \
494         typedef stack::Types< value_type >::type_name stack_type; \
495         stack_type stack( s_nEliminationSize ); \
496         test_elimination( stack ); \
497     }
498
499 #define CDSSTRESS_TreiberStack( test_fixture ) \
500     CDSSTRESS_Stack_F( test_fixture, Treiber_HP )        \
501     CDSSTRESS_Stack_F( test_fixture, Treiber_HP_seqcst ) \
502     CDSSTRESS_Stack_F( test_fixture, Treiber_HP_pause )  \
503     CDSSTRESS_Stack_F( test_fixture, Treiber_HP_exp )    \
504     CDSSTRESS_Stack_F( test_fixture, Treiber_HP_stat   ) \
505     CDSSTRESS_Stack_F( test_fixture, Treiber_DHP       ) \
506     CDSSTRESS_Stack_F( test_fixture, Treiber_DHP_pause ) \
507     CDSSTRESS_Stack_F( test_fixture, Treiber_DHP_exp   ) \
508     CDSSTRESS_Stack_F( test_fixture, Treiber_DHP_stat  ) \
509
510 #define CDSSTRESS_EliminationStack( test_fixture ) \
511     CDSSTRESS_EliminationStack_F( test_fixture, Elimination_HP        ) \
512     CDSSTRESS_EliminationStack_F( test_fixture, Elimination_HP_2ms    ) \
513     CDSSTRESS_EliminationStack_F( test_fixture, Elimination_HP_2ms_stat) \
514     CDSSTRESS_EliminationStack_F( test_fixture, Elimination_HP_5ms    ) \
515     CDSSTRESS_EliminationStack_F( test_fixture, Elimination_HP_5ms_stat) \
516     CDSSTRESS_EliminationStack_F( test_fixture, Elimination_HP_10ms    ) \
517     CDSSTRESS_EliminationStack_F( test_fixture, Elimination_HP_10ms_stat) \
518     CDSSTRESS_EliminationStack_F( test_fixture, Elimination_HP_seqcst ) \
519     CDSSTRESS_EliminationStack_F( test_fixture, Elimination_HP_pause  ) \
520     CDSSTRESS_EliminationStack_F( test_fixture, Elimination_HP_exp    ) \
521     CDSSTRESS_EliminationStack_F( test_fixture, Elimination_HP_stat   ) \
522     CDSSTRESS_EliminationStack_F( test_fixture, Elimination_HP_dyn    ) \
523     CDSSTRESS_EliminationStack_F( test_fixture, Elimination_HP_dyn_stat) \
524     CDSSTRESS_EliminationStack_F( test_fixture, Elimination_DHP       ) \
525     CDSSTRESS_EliminationStack_F( test_fixture, Elimination_DHP_2ms    ) \
526     CDSSTRESS_EliminationStack_F( test_fixture, Elimination_DHP_2ms_stat) \
527     CDSSTRESS_EliminationStack_F( test_fixture, Elimination_DHP_5ms    ) \
528     CDSSTRESS_EliminationStack_F( test_fixture, Elimination_DHP_5ms_stat) \
529     CDSSTRESS_EliminationStack_F( test_fixture, Elimination_DHP_10ms    ) \
530     CDSSTRESS_EliminationStack_F( test_fixture, Elimination_DHP_10ms_stat) \
531     CDSSTRESS_EliminationStack_F( test_fixture, Elimination_DHP_pause ) \
532     CDSSTRESS_EliminationStack_F( test_fixture, Elimination_DHP_exp   ) \
533     CDSSTRESS_EliminationStack_F( test_fixture, Elimination_DHP_stat  ) \
534     CDSSTRESS_EliminationStack_F( test_fixture, Elimination_DHP_dyn   ) \
535     CDSSTRESS_EliminationStack_F( test_fixture, Elimination_DHP_dyn_stat)
536
537 #define CDSSTRESS_FCStack( test_fixture ) \
538     CDSSTRESS_Stack_F( test_fixture, FCStack_deque ) \
539     CDSSTRESS_Stack_F( test_fixture, FCStack_deque_mutex ) \
540     CDSSTRESS_Stack_F( test_fixture, FCStack_deque_stat ) \
541     CDSSTRESS_Stack_F( test_fixture, FCStack_deque_elimination ) \
542     CDSSTRESS_Stack_F( test_fixture, FCStack_deque_elimination_stat ) \
543     CDSSTRESS_Stack_F( test_fixture, FCStack_vector ) \
544     CDSSTRESS_Stack_F( test_fixture, FCStack_vector_mutex ) \
545     CDSSTRESS_Stack_F( test_fixture, FCStack_vector_stat ) \
546     CDSSTRESS_Stack_F( test_fixture, FCStack_vector_elimination ) \
547     CDSSTRESS_Stack_F( test_fixture, FCStack_vector_elimination_stat ) \
548     CDSSTRESS_Stack_F( test_fixture, FCStack_list ) \
549     CDSSTRESS_Stack_F( test_fixture, FCStack_list_mutex ) \
550     CDSSTRESS_Stack_F( test_fixture, FCStack_list_stat ) \
551     CDSSTRESS_Stack_F( test_fixture, FCStack_list_elimination ) \
552     CDSSTRESS_Stack_F( test_fixture, FCStack_list_elimination_stat )
553
554 #define CDSSTRESS_FCDeque( test_fixture ) \
555     CDSSTRESS_Stack_F( test_fixture, FCDequeL_default ) \
556     CDSSTRESS_Stack_F( test_fixture, FCDequeL_mutex ) \
557     CDSSTRESS_Stack_F( test_fixture, FCDequeL_stat ) \
558     CDSSTRESS_Stack_F( test_fixture, FCDequeL_elimination ) \
559     CDSSTRESS_Stack_F( test_fixture, FCDequeL_elimination_stat ) \
560     CDSSTRESS_Stack_F( test_fixture, FCDequeR_default ) \
561     CDSSTRESS_Stack_F( test_fixture, FCDequeR_mutex ) \
562     CDSSTRESS_Stack_F( test_fixture, FCDequeR_stat ) \
563     CDSSTRESS_Stack_F( test_fixture, FCDequeR_elimination ) \
564     CDSSTRESS_Stack_F( test_fixture, FCDequeR_elimination_stat )
565
566 #define CDSSTRESS_StdStack( test_fixture ) \
567     CDSSTRESS_Stack_F( test_fixture, StdStack_Deque_Mutex  ) \
568     CDSSTRESS_Stack_F( test_fixture, StdStack_Deque_Spin   ) \
569     CDSSTRESS_Stack_F( test_fixture, StdStack_Vector_Mutex ) \
570     CDSSTRESS_Stack_F( test_fixture, StdStack_Vector_Spin  ) \
571     CDSSTRESS_Stack_F( test_fixture, StdStack_List_Mutex   ) \
572     CDSSTRESS_Stack_F( test_fixture, StdStack_List_Spin    )
573
574
575 #endif // #ifndef CDSSTRESS_STACK_TYPES_H