*/
namespace treiber_stack {
/// Internal statistics
- template <typename Counter = cds::atomicity::event_counter>
+ template <typename Counter = cds::intrusive::treiber_stack::stat<>::counter_type >
using stat = cds::intrusive::treiber_stack::stat< Counter >;
/// Dummy internal statistics
Default is \p opt::v::c_rand.
- opt::elimination_backoff - back-off strategy to wait for elimination, default is \p cds::backoff::delay<>
- opt::lock_type - a lock type used in elimination back-off, default is \p cds::lock::Spin.
+
+ Example: declare %TreiberStack with item counting and internal statistics using \p %make_traits
+ \code
+ typedef cds::container::TreiberStack< cds::gc::HP, Foo,
+ typename cds::container::treiber_stack::make_traits<
+ cds::opt::item_counter< cds::atomicity::item_counter >,
+ cds::opt::stat< cds::intrusive::treiber_stack::stat<> >
+ >::type
+ > myStack;
+ \endcode
*/
template <typename... Options>
struct make_traits {
/// Rebind template arguments
template <typename GC2, typename T2, typename Traits2>
struct rebind {
- typedef TreiberStack< GC2, T2, Traits2> other ; ///< Rebinding result
+ typedef TreiberStack< GC2, T2, Traits2 > other; ///< Rebinding result
};
public:
typedef typename options::gc gc;
typedef typename options::tag tag;
typedef node<gc, tag> node_type;
- typedef HookType hook_type;
+ typedef HookType hook_type;
};
//@endcond
#define __CDS_INTRUSIVE_TREIBER_STACK_H
#include <type_traits>
-#include <functional> // ref
#include <mutex> // unique_lock
#include <cds/intrusive/details/single_link_struct.h>
#include <cds/algo/elimination.h>
else
++m_PassivePopCollision;
}
- void onEliminationFailed() { ++m_EliminationFailed;}
+ void onEliminationFailed()
+ {
+ ++m_EliminationFailed;
+ }
//@endcond
};
Default is \p opt::v::c_rand.
- opt::elimination_backoff - back-off strategy to wait for elimination, default is \p cds::backoff::delay<>
- opt::lock_type - a lock type used in elimination back-off, default is \p cds::lock::Spin.
+
+ Example: declare \P %TreiberStack with elimination enabled and internal statistics
+ \code
+ typedef cds::intrusive::TreiberStack< cds::gc::HP, Foo,
+ typename cds::intrusive::treiber_stack::make_traits<
+ cds::opt::enable_elimination< true >,
+ cds::opt::stat< cds::container::treiber_stack::stat<> >
+ >::type
+ > myStack;
+ \endcode
+
*/
template <typename... Options>
struct make_traits {
typedef Traits traits; ///< Stack traits
typedef typename traits::hook hook; ///< hook type
- typedef typename traits::node_type node_type; ///< node type
+ typedef typename hook::node_type node_type; ///< node type
typedef typename traits::disposer disposer; ///< disposer used
typedef typename get_node_traits< value_type, node_type, hook>::type node_traits ; ///< node traits
typedef typename single_link::get_link_checker< node_type, traits::link_checker >::type link_checker ; ///< link checker
typedef intrusive::node_to_value<TreiberStack> node_to_value;
typedef treiber_stack::operation< value_type > operation_desc;
+
+ // GC and node_type::gc must be the same
+ static_assert( std::is_same<gc, typename node_type::gc>::value, "GC and node_type::gc must be the same");
+
+ static_assert( !enable_elimination || std::is_same<typename elimination_random_engine::result_type, unsigned int>::value,
+ "Random engine result type must be unsigned int");
//@endcond
protected:
template <bool EnableElimination>
struct elimination_backoff_impl;
-
- void init()
- {
- // GC and node_type::gc must be the same
- static_assert(( std::is_same<gc, typename node_type::gc>::value ), "GC and node_type::gc must be the same");
-
- static_assert( (!enable_elimination || std::is_same<typename elimination_random_engine::result_type, unsigned int>::value),
- "Random engine result type must be unsigned int" );
- }
//@endcond
public:
/// Constructs empty stack
TreiberStack()
: m_Top( nullptr )
- {
- init();
- }
+ {}
/// Constructs empty stack and initializes elimination back-off data
/**
TreiberStack( size_t nCollisionCapacity )
: m_Top( nullptr )
, m_Backoff( nCollisionCapacity )
- {
- init();
- }
+ {}
/// \p %TreiberStack is not copy-constructible
TreiberStack( TreiberStack const& ) = delete;
typedef cs::TreiberStack< cds::gc::DHP, int
, typename cs::treiber_stack::make_traits<
- ,cds::opt::back_off< cds::backoff::pause>
+ cds::opt::back_off< cds::backoff::pause >
,cds::opt::allocator< std::allocator< bool * > >
,cds::opt::enable_elimination<true>
>::type
, typename ci::treiber_stack::make_traits<
cds::opt::enable_elimination<true>
,ci::opt::hook<
- ci::single_link::base_hook< ci::opt::gc<cds::gc::DHP> >
+ ci::treiber_stack::base_hook< ci::opt::gc<cds::gc::DHP> >
>
>::type
> Elimination_DHP_base;
TestIntrusiveStack::base_hook_item<cds::gc::DHP>
, typename ci::treiber_stack::make_traits<
ci::opt::hook<
- ci::single_link::base_hook< ci::opt::gc<cds::gc::DHP> >
+ ci::treiber_stack::base_hook< ci::opt::gc<cds::gc::DHP> >
>
,cds::opt::enable_elimination<true>
,ci::opt::buffer< ci::opt::v::dynamic_buffer<void *> >
TestIntrusiveStack::base_hook_item<cds::gc::DHP>
, typename ci::treiber_stack::make_traits<
ci::opt::hook<
- ci::single_link::base_hook< ci::opt::gc<cds::gc::DHP> >
+ ci::treiber_stack::base_hook< ci::opt::gc<cds::gc::DHP> >
>
,cds::opt::enable_elimination<true>
,ci::opt::memory_model< ci::opt::v::relaxed_ordering >
TestIntrusiveStack::base_hook_item<cds::gc::DHP>
, typename ci::treiber_stack::make_traits<
ci::opt::hook<
- ci::single_link::base_hook< ci::opt::gc<cds::gc::DHP> >
+ ci::treiber_stack::base_hook< ci::opt::gc<cds::gc::DHP> >
>
,cds::opt::enable_elimination<true>
,ci::opt::disposer< TestIntrusiveStack::faked_disposer >
TestIntrusiveStack::base_hook_item<cds::gc::DHP>
, typename ci::treiber_stack::make_traits<
ci::opt::hook<
- ci::single_link::base_hook< ci::opt::gc<cds::gc::DHP> >
+ ci::treiber_stack::base_hook< ci::opt::gc<cds::gc::DHP> >
>
,cds::opt::enable_elimination<true>
,ci::opt::disposer< TestIntrusiveStack::faked_disposer >
TestIntrusiveStack::member_hook_item<cds::gc::DHP>
, typename ci::treiber_stack::make_traits<
ci::opt::hook<
- ci::single_link::member_hook<
+ ci::treiber_stack::member_hook<
offsetof(TestIntrusiveStack::member_hook_item<cds::gc::DHP>, hMember),
ci::opt::gc<cds::gc::DHP>
>
TestIntrusiveStack::member_hook_item<cds::gc::DHP>
, typename ci::treiber_stack::make_traits<
ci::opt::hook<
- ci::single_link::member_hook<
+ ci::treiber_stack::member_hook<
offsetof(TestIntrusiveStack::member_hook_item<cds::gc::DHP>, hMember),
ci::opt::gc<cds::gc::DHP>
>
TestIntrusiveStack::member_hook_item<cds::gc::DHP>
, typename ci::treiber_stack::make_traits<
ci::opt::hook<
- ci::single_link::member_hook<
+ ci::treiber_stack::member_hook<
offsetof(TestIntrusiveStack::member_hook_item<cds::gc::DHP>, hMember),
ci::opt::gc<cds::gc::DHP>
>
TestIntrusiveStack::member_hook_item<cds::gc::DHP>
, typename ci::treiber_stack::make_traits<
ci::opt::hook<
- ci::single_link::member_hook<
+ ci::treiber_stack::member_hook<
offsetof(TestIntrusiveStack::member_hook_item<cds::gc::DHP>, hMember),
ci::opt::gc<cds::gc::DHP>
>
TestIntrusiveStack::member_hook_item<cds::gc::DHP>
, typename ci::treiber_stack::make_traits<
ci::opt::hook<
- ci::single_link::member_hook<
+ ci::treiber_stack::member_hook<
offsetof(TestIntrusiveStack::member_hook_item<cds::gc::DHP>, hMember),
ci::opt::gc<cds::gc::DHP>
>
, typename ci::treiber_stack::make_traits<
cds::opt::enable_elimination<true>
,ci::opt::hook<
- ci::single_link::base_hook<
+ ci::treiber_stack::base_hook<
ci::opt::gc<cds::gc::HP>
>
>
, typename ci::treiber_stack::make_traits<
cds::opt::enable_elimination<true>
,ci::opt::hook<
- ci::single_link::base_hook<
+ ci::treiber_stack::base_hook<
ci::opt::gc<cds::gc::HP>
>
>
, typename ci::treiber_stack::make_traits<
cds::opt::enable_elimination<true>
,ci::opt::hook<
- ci::single_link::base_hook<
+ ci::treiber_stack::base_hook<
ci::opt::gc<cds::gc::HP>
>
>
, typename ci::treiber_stack::make_traits<
cds::opt::enable_elimination<true>
,ci::opt::hook<
- ci::single_link::base_hook< ci::opt::gc<cds::gc::HP> >
+ ci::treiber_stack::base_hook< ci::opt::gc<cds::gc::HP> >
>
,ci::opt::disposer< TestIntrusiveStack::faked_disposer >
>::type
, typename ci::treiber_stack::make_traits<
cds::opt::enable_elimination<true>
,ci::opt::hook<
- ci::single_link::base_hook< ci::opt::gc<cds::gc::HP> >
+ ci::treiber_stack::base_hook< ci::opt::gc<cds::gc::HP> >
>
,ci::opt::disposer< TestIntrusiveStack::faked_disposer >
,ci::opt::memory_model< ci::opt::v::relaxed_ordering >
, typename ci::treiber_stack::make_traits<
cds::opt::enable_elimination<true>
,ci::opt::hook<
- ci::single_link::member_hook<
+ ci::treiber_stack::member_hook<
offsetof(TestIntrusiveStack::member_hook_item<cds::gc::HP>, hMember),
ci::opt::gc<cds::gc::HP>
>
, typename ci::treiber_stack::make_traits<
cds::opt::enable_elimination<true>
,ci::opt::hook<
- ci::single_link::member_hook<
+ ci::treiber_stack::member_hook<
offsetof(TestIntrusiveStack::member_hook_item<cds::gc::HP>, hMember),
ci::opt::gc<cds::gc::HP>
>
, typename ci::treiber_stack::make_traits<
cds::opt::enable_elimination<true>
,ci::opt::hook<
- ci::single_link::member_hook<
+ ci::treiber_stack::member_hook<
offsetof(TestIntrusiveStack::member_hook_item<cds::gc::HP>, hMember),
ci::opt::gc<cds::gc::HP>
>
, typename ci::treiber_stack::make_traits<
cds::opt::enable_elimination<true>
,ci::opt::hook<
- ci::single_link::member_hook<
+ ci::treiber_stack::member_hook<
offsetof(TestIntrusiveStack::member_hook_item<cds::gc::HP>, hMember),
ci::opt::gc<cds::gc::HP>
>
, typename ci::treiber_stack::make_traits<
cds::opt::enable_elimination<true>
,ci::opt::hook<
- ci::single_link::member_hook<
+ ci::treiber_stack::member_hook<
offsetof(TestIntrusiveStack::member_hook_item<cds::gc::HP>, hMember),
ci::opt::gc<cds::gc::HP>
>
//$$CDS-header$$
#include "hdr_intrusive_treiber_stack.h"
-#include <cds/gc/ptb.h>
+#include <cds/gc/dhp.h>
#include <cds/intrusive/treiber_stack.h>
namespace stack {
TestIntrusiveStack::base_hook_item<cds::gc::DHP>
,typename ci::treiber_stack::make_traits<
ci::opt::hook<
- ci::single_link::base_hook< ci::opt::gc<cds::gc::DHP> >
+ ci::treiber_stack::base_hook< ci::opt::gc<cds::gc::DHP> >
>
>::type
> Treiber_DHP_base;
TestIntrusiveStack::base_hook_item<cds::gc::DHP>
,typename ci::treiber_stack::make_traits<
ci::opt::hook<
- ci::single_link::base_hook< ci::opt::gc<cds::gc::DHP> >
+ ci::treiber_stack::base_hook< ci::opt::gc<cds::gc::DHP> >
>
,ci::opt::memory_model< ci::opt::v::relaxed_ordering >
>::type
TestIntrusiveStack::base_hook_item<cds::gc::DHP>
,typename ci::treiber_stack::make_traits<
ci::opt::hook<
- ci::single_link::base_hook< ci::opt::gc<cds::gc::DHP> >
+ ci::treiber_stack::base_hook< ci::opt::gc<cds::gc::DHP> >
>
,ci::opt::disposer< TestIntrusiveStack::faked_disposer >
>::type
TestIntrusiveStack::base_hook_item<cds::gc::DHP>
,typename ci::treiber_stack::make_traits<
ci::opt::hook<
- ci::single_link::base_hook< ci::opt::gc<cds::gc::DHP> >
+ ci::treiber_stack::base_hook< ci::opt::gc<cds::gc::DHP> >
>
,ci::opt::disposer< TestIntrusiveStack::faked_disposer >
,ci::opt::memory_model< ci::opt::v::relaxed_ordering >
TestIntrusiveStack::member_hook_item<cds::gc::DHP>
,typename ci::treiber_stack::make_traits<
ci::opt::hook<
- ci::single_link::member_hook<
+ ci::treiber_stack::member_hook<
offsetof(TestIntrusiveStack::member_hook_item<cds::gc::DHP>, hMember),
ci::opt::gc<cds::gc::DHP>
>
TestIntrusiveStack::member_hook_item<cds::gc::DHP>
,typename ci::treiber_stack::make_traits<
ci::opt::hook<
- ci::single_link::member_hook<
+ ci::treiber_stack::member_hook<
offsetof(TestIntrusiveStack::member_hook_item<cds::gc::DHP>, hMember),
ci::opt::gc<cds::gc::DHP>
>
TestIntrusiveStack::member_hook_item<cds::gc::DHP>
, typename ci::treiber_stack::make_traits<
ci::opt::hook<
- ci::single_link::member_hook<
+ ci::treiber_stack::member_hook<
offsetof(TestIntrusiveStack::member_hook_item<cds::gc::DHP>, hMember),
ci::opt::gc<cds::gc::DHP>
>
TestIntrusiveStack::member_hook_item<cds::gc::DHP>
, typename ci::treiber_stack::make_traits<
ci::opt::hook<
- ci::single_link::member_hook<
+ ci::treiber_stack::member_hook<
offsetof(TestIntrusiveStack::member_hook_item<cds::gc::DHP>, hMember),
ci::opt::gc<cds::gc::DHP>
>
// HZP GC + base hook
typedef cds::intrusive::TreiberStack< cds::gc::HP,
TestIntrusiveStack::base_hook_item<cds::gc::HP>
- ,ci::opt::hook<
- ci::single_link::base_hook<
- ci::opt::gc<cds::gc::HP>
+ , typename ci::treiber_stack::make_traits<
+ ci::opt::hook<
+ ci::treiber_stack::base_hook<
+ ci::opt::gc<cds::gc::HP>
+ >
>
- >
+ >::type
> Treiber_HP_base;
struct traits_Treiber_HP_base_relaxed
: ci::treiber_stack::make_traits <
ci::opt::hook<
- ci::single_link::base_hook<
+ ci::treiber_stack::base_hook<
ci::opt::gc<cds::gc::HP>
>
>
struct traits_Treiber_HP_base_disposer
: ci::treiber_stack::make_traits <
ci::opt::hook<
- ci::single_link::base_hook< ci::opt::gc<cds::gc::HP> >
+ ci::treiber_stack::base_hook< ci::opt::gc<cds::gc::HP> >
>
,ci::opt::disposer< TestIntrusiveStack::faked_disposer >
>::type
TestIntrusiveStack::base_hook_item<cds::gc::HP>
,typename ci::treiber_stack::make_traits <
ci::opt::hook<
- ci::single_link::base_hook< ci::opt::gc<cds::gc::HP> >
+ ci::treiber_stack::base_hook< ci::opt::gc<cds::gc::HP> >
>
,ci::opt::disposer< TestIntrusiveStack::faked_disposer >
,ci::opt::memory_model< ci::opt::v::relaxed_ordering >
struct traits_Treiber_HP_member
: ci::treiber_stack::make_traits <
ci::opt::hook<
- ci::single_link::member_hook<
+ ci::treiber_stack::member_hook<
offsetof(TestIntrusiveStack::member_hook_item<cds::gc::HP>, hMember),
ci::opt::gc<cds::gc::HP>
>
struct traits_Treiber_HP_member_relaxed
: ci::treiber_stack::make_traits <
ci::opt::hook<
- ci::single_link::member_hook<
+ ci::treiber_stack::member_hook<
offsetof(TestIntrusiveStack::member_hook_item<cds::gc::HP>, hMember),
ci::opt::gc<cds::gc::HP>
>
struct traits_Treiber_HP_member_disposer
: ci::treiber_stack::make_traits <
ci::opt::hook<
- ci::single_link::member_hook<
+ ci::treiber_stack::member_hook<
offsetof(TestIntrusiveStack::member_hook_item<cds::gc::HP>, hMember),
ci::opt::gc<cds::gc::HP>
>
struct traits_Treiber_HP_member_disposer_relaxed
: ci::treiber_stack::make_traits <
ci::opt::hook<
- ci::single_link::member_hook<
+ ci::treiber_stack::member_hook<
offsetof(TestIntrusiveStack::member_hook_item<cds::gc::HP>, hMember),
ci::opt::gc<cds::gc::HP>
>
CPPUNIT_ASSERT( stack.pop(v) );
CPPUNIT_ASSERT( v == 3 );
CPPUNIT_ASSERT( !stack.empty() );
- CPPUNIT_ASSERT( stack.pop_with( [&v]( value_type& src ) { v = src; } );
+ CPPUNIT_ASSERT( stack.pop_with( [&v]( value_type& src ) { v = src; } ));
CPPUNIT_ASSERT( v == 2 );
CPPUNIT_ASSERT( !stack.empty() );
CPPUNIT_ASSERT( stack.pop(v) );
//$$CDS-header$$
#include "hdr_treiber_stack.h"
-#include <cds/gc/ptb.h>
+#include <cds/gc/dhp.h>
#include <cds/container/treiber_stack.h>
namespace stack {
namespace defs { namespace {
- typedef cs::TreiberStack< cds::gc::PTB, int > Treiber_PTB;
- typedef cs::TreiberStack< cds::gc::PTB, int
+ typedef cs::TreiberStack< cds::gc::DHP, int > Treiber_DHP;
+ typedef cs::TreiberStack< cds::gc::DHP, int
, typename cs::treiber_stack::make_traits<
cds::opt::memory_model<cds::opt::v::relaxed_ordering>
>::type
- > Treiber_PTB_relaxed;
+ > Treiber_DHP_relaxed;
- typedef cs::TreiberStack< cds::gc::PTB, int
+ typedef cs::TreiberStack< cds::gc::DHP, int
, typename cs::treiber_stack::make_traits<
cds::opt::back_off< cds::backoff::yield>
>::type
- > Treiber_PTB_yield;
+ > Treiber_DHP_yield;
- typedef cs::TreiberStack< cds::gc::PTB, int
+ typedef cs::TreiberStack< cds::gc::DHP, int
, typename cs::treiber_stack::make_traits<
cds::opt::back_off< cds::backoff::yield>
,cds::opt::memory_model<cds::opt::v::relaxed_ordering>
>::type
- > Treiber_PTB_yield_relaxed;
+ > Treiber_DHP_yield_relaxed;
- typedef cs::TreiberStack< cds::gc::PTB, int
+ typedef cs::TreiberStack< cds::gc::DHP, int
, typename cs::treiber_stack::make_traits<
cds::opt::back_off< cds::backoff::pause>
,cds::opt::allocator< std::allocator< bool * > >
>::type
- > Treiber_PTB_pause_alloc;
+ > Treiber_DHP_pause_alloc;
- typedef cs::TreiberStack< cds::gc::PTB, int
+ typedef cs::TreiberStack< cds::gc::DHP, int
, typename cs::treiber_stack::make_traits<
cds::opt::memory_model<cds::opt::v::relaxed_ordering>
,cds::opt::back_off< cds::backoff::pause>
,cds::opt::allocator< std::allocator< bool * > >
>::type
- > Treiber_PTB_pause_alloc_relaxed;
+ > Treiber_DHP_pause_alloc_relaxed;
}}
- TEST(Treiber_PTB)
- TEST(Treiber_PTB_yield)
- TEST(Treiber_PTB_pause_alloc)
+ TEST(Treiber_DHP)
+ TEST(Treiber_DHP_yield)
+ TEST(Treiber_DHP_pause_alloc)
- TEST(Treiber_PTB_relaxed)
- TEST(Treiber_PTB_yield_relaxed)
- TEST(Treiber_PTB_pause_alloc_relaxed)
+ TEST(Treiber_DHP_relaxed)
+ TEST(Treiber_DHP_yield_relaxed)
+ TEST(Treiber_DHP_pause_alloc_relaxed)
}
#define __CDSUNIT_INTRUSIVE_STACK_DEFS_H
#define CDSUNIT_DECLARE_TreiberStack \
- TEST_CASE( Treiber_HP, cds::intrusive::single_link::node< cds::gc::HP > ) \
- TEST_CASE( Treiber_HP_seqcst, cds::intrusive::single_link::node< cds::gc::HP > ) \
- /*TEST_CASE( Treiber_HP_yield, cds::intrusive::single_link::node< cds::gc::HP > )*/ \
- TEST_CASE( Treiber_HP_pause, cds::intrusive::single_link::node< cds::gc::HP > ) \
- TEST_CASE( Treiber_HP_exp, cds::intrusive::single_link::node< cds::gc::HP > ) \
- TEST_CASE( Treiber_HP_stat, cds::intrusive::single_link::node< cds::gc::HP > ) \
- /*TEST_CASE( Treiber_HRC_yield, cds::intrusive::single_link::node< cds::gc::HRC > )*/ \
- TEST_CASE( Treiber_DHP, cds::intrusive::single_link::node< cds::gc::DHP > ) \
- /*TEST_CASE( Treiber_DHP_yield, cds::intrusive::single_link::node< cds::gc::DHP > )*/ \
- TEST_CASE( Treiber_DHP_pause, cds::intrusive::single_link::node< cds::gc::DHP > ) \
- TEST_CASE( Treiber_DHP_exp, cds::intrusive::single_link::node< cds::gc::DHP > ) \
- TEST_CASE( Treiber_DHP_stat, cds::intrusive::single_link::node< cds::gc::DHP > )
+ TEST_CASE( Treiber_HP, cds::intrusive::treiber_stack::node< cds::gc::HP > ) \
+ TEST_CASE( Treiber_HP_seqcst, cds::intrusive::treiber_stack::node< cds::gc::HP > ) \
+ /*TEST_CASE( Treiber_HP_yield, cds::intrusive::treiber_stack::node< cds::gc::HP > )*/ \
+ TEST_CASE( Treiber_HP_pause, cds::intrusive::treiber_stack::node< cds::gc::HP > ) \
+ TEST_CASE( Treiber_HP_exp, cds::intrusive::treiber_stack::node< cds::gc::HP > ) \
+ TEST_CASE( Treiber_HP_stat, cds::intrusive::treiber_stack::node< cds::gc::HP > ) \
+ /*TEST_CASE( Treiber_HRC_yield, cds::intrusive::treiber_stack::node< cds::gc::HRC > )*/ \
+ TEST_CASE( Treiber_DHP, cds::intrusive::treiber_stack::node< cds::gc::DHP > ) \
+ /*TEST_CASE( Treiber_DHP_yield, cds::intrusive::treiber_stack::node< cds::gc::DHP > )*/ \
+ TEST_CASE( Treiber_DHP_pause, cds::intrusive::treiber_stack::node< cds::gc::DHP > ) \
+ TEST_CASE( Treiber_DHP_exp, cds::intrusive::treiber_stack::node< cds::gc::DHP > ) \
+ TEST_CASE( Treiber_DHP_stat, cds::intrusive::treiber_stack::node< cds::gc::DHP > )
#define CDSUNIT_TEST_TreiberStack \
CPPUNIT_TEST( Treiber_HP ) \
CPPUNIT_TEST( Treiber_DHP_stat )
#define CDSUNIT_DECLARE_EliminationStack \
- TEST_ELIMINATION( Elimination_HP, cds::intrusive::single_link::node< cds::gc::HP > ) \
- TEST_ELIMINATION( Elimination_HP_2ms, cds::intrusive::single_link::node< cds::gc::HP > ) \
- TEST_ELIMINATION( Elimination_HP_2ms_stat, cds::intrusive::single_link::node< cds::gc::HP >) \
- TEST_ELIMINATION( Elimination_HP_5ms, cds::intrusive::single_link::node< cds::gc::HP > ) \
- TEST_ELIMINATION( Elimination_HP_5ms_stat, cds::intrusive::single_link::node< cds::gc::HP >) \
- TEST_ELIMINATION( Elimination_HP_10ms, cds::intrusive::single_link::node< cds::gc::HP > ) \
- TEST_ELIMINATION( Elimination_HP_10ms_stat, cds::intrusive::single_link::node< cds::gc::HP >) \
- TEST_ELIMINATION( Elimination_HP_seqcst, cds::intrusive::single_link::node< cds::gc::HP > ) \
- /*TEST_ELIMINATION( Elimination_HP_yield, cds::intrusive::single_link::node< cds::gc::HP > )*/ \
- TEST_ELIMINATION( Elimination_HP_pause, cds::intrusive::single_link::node< cds::gc::HP > ) \
- TEST_ELIMINATION( Elimination_HP_exp, cds::intrusive::single_link::node< cds::gc::HP > ) \
- TEST_ELIMINATION( Elimination_HP_stat, cds::intrusive::single_link::node< cds::gc::HP > ) \
- TEST_ELIMINATION( Elimination_HP_dyn, cds::intrusive::single_link::node< cds::gc::HP > ) \
- TEST_ELIMINATION( Elimination_HP_dyn_stat, cds::intrusive::single_link::node< cds::gc::HP >) \
- TEST_ELIMINATION( Elimination_DHP, cds::intrusive::single_link::node< cds::gc::DHP > ) \
- TEST_ELIMINATION( Elimination_DHP_2ms, cds::intrusive::single_link::node< cds::gc::DHP > ) \
- TEST_ELIMINATION( Elimination_DHP_2ms_stat, cds::intrusive::single_link::node< cds::gc::DHP >) \
- TEST_ELIMINATION( Elimination_DHP_5ms, cds::intrusive::single_link::node< cds::gc::DHP > ) \
- TEST_ELIMINATION( Elimination_DHP_5ms_stat, cds::intrusive::single_link::node< cds::gc::DHP >) \
- TEST_ELIMINATION( Elimination_DHP_10ms, cds::intrusive::single_link::node< cds::gc::DHP > ) \
- TEST_ELIMINATION( Elimination_DHP_10ms_stat, cds::intrusive::single_link::node< cds::gc::DHP >) \
- /*TEST_ELIMINATION( Elimination_DHP_yield, cds::intrusive::single_link::node< cds::gc::DHP > )*/ \
- TEST_ELIMINATION( Elimination_DHP_pause, cds::intrusive::single_link::node< cds::gc::DHP > ) \
- TEST_ELIMINATION( Elimination_DHP_exp, cds::intrusive::single_link::node< cds::gc::DHP > ) \
- TEST_ELIMINATION( Elimination_DHP_stat, cds::intrusive::single_link::node< cds::gc::DHP > ) \
- TEST_ELIMINATION( Elimination_DHP_dyn, cds::intrusive::single_link::node< cds::gc::DHP > ) \
- TEST_ELIMINATION( Elimination_DHP_dyn_stat, cds::intrusive::single_link::node< cds::gc::DHP >)
+ TEST_ELIMINATION( Elimination_HP, cds::intrusive::treiber_stack::node< cds::gc::HP > ) \
+ TEST_ELIMINATION( Elimination_HP_2ms, cds::intrusive::treiber_stack::node< cds::gc::HP > ) \
+ TEST_ELIMINATION( Elimination_HP_2ms_stat, cds::intrusive::treiber_stack::node< cds::gc::HP >) \
+ TEST_ELIMINATION( Elimination_HP_5ms, cds::intrusive::treiber_stack::node< cds::gc::HP > ) \
+ TEST_ELIMINATION( Elimination_HP_5ms_stat, cds::intrusive::treiber_stack::node< cds::gc::HP >) \
+ TEST_ELIMINATION( Elimination_HP_10ms, cds::intrusive::treiber_stack::node< cds::gc::HP > ) \
+ TEST_ELIMINATION( Elimination_HP_10ms_stat, cds::intrusive::treiber_stack::node< cds::gc::HP >) \
+ TEST_ELIMINATION( Elimination_HP_seqcst, cds::intrusive::treiber_stack::node< cds::gc::HP > ) \
+ /*TEST_ELIMINATION( Elimination_HP_yield, cds::intrusive::treiber_stack::node< cds::gc::HP > )*/ \
+ TEST_ELIMINATION( Elimination_HP_pause, cds::intrusive::treiber_stack::node< cds::gc::HP > ) \
+ TEST_ELIMINATION( Elimination_HP_exp, cds::intrusive::treiber_stack::node< cds::gc::HP > ) \
+ TEST_ELIMINATION( Elimination_HP_stat, cds::intrusive::treiber_stack::node< cds::gc::HP > ) \
+ TEST_ELIMINATION( Elimination_HP_dyn, cds::intrusive::treiber_stack::node< cds::gc::HP > ) \
+ TEST_ELIMINATION( Elimination_HP_dyn_stat, cds::intrusive::treiber_stack::node< cds::gc::HP >) \
+ TEST_ELIMINATION( Elimination_DHP, cds::intrusive::treiber_stack::node< cds::gc::DHP > ) \
+ TEST_ELIMINATION( Elimination_DHP_2ms, cds::intrusive::treiber_stack::node< cds::gc::DHP > ) \
+ TEST_ELIMINATION( Elimination_DHP_2ms_stat, cds::intrusive::treiber_stack::node< cds::gc::DHP >) \
+ TEST_ELIMINATION( Elimination_DHP_5ms, cds::intrusive::treiber_stack::node< cds::gc::DHP > ) \
+ TEST_ELIMINATION( Elimination_DHP_5ms_stat, cds::intrusive::treiber_stack::node< cds::gc::DHP >) \
+ TEST_ELIMINATION( Elimination_DHP_10ms, cds::intrusive::treiber_stack::node< cds::gc::DHP > ) \
+ TEST_ELIMINATION( Elimination_DHP_10ms_stat, cds::intrusive::treiber_stack::node< cds::gc::DHP >) \
+ TEST_ELIMINATION( Elimination_DHP_seqcst, cds::intrusive::treiber_stack::node< cds::gc::DHP > ) \
+ /*TEST_ELIMINATION( Elimination_DHP_yield, cds::intrusive::treiber_stack::node< cds::gc::DHP > )*/ \
+ TEST_ELIMINATION( Elimination_DHP_pause, cds::intrusive::treiber_stack::node< cds::gc::DHP > ) \
+ TEST_ELIMINATION( Elimination_DHP_exp, cds::intrusive::treiber_stack::node< cds::gc::DHP > ) \
+ TEST_ELIMINATION( Elimination_DHP_stat, cds::intrusive::treiber_stack::node< cds::gc::DHP > ) \
+ TEST_ELIMINATION( Elimination_DHP_dyn, cds::intrusive::treiber_stack::node< cds::gc::DHP > ) \
+ TEST_ELIMINATION( Elimination_DHP_dyn_stat, cds::intrusive::treiber_stack::node< cds::gc::DHP >)
#define CDSUNIT_TEST_EliminationStack \
CPPUNIT_TEST( Elimination_HP ) \
CPPUNIT_TEST( Elimination_HP_stat ) \
CPPUNIT_TEST( Elimination_HP_dyn ) \
CPPUNIT_TEST( Elimination_HP_dyn_stat) \
- CPPUNIT_TEST( Elimination_DHP ) \
+ CPPUNIT_TEST( Elimination_DHP ) \
+ CPPUNIT_TEST( Elimination_DHP_seqcst ) \
CPPUNIT_TEST( Elimination_DHP_2ms ) \
CPPUNIT_TEST( Elimination_DHP_2ms_stat) \
CPPUNIT_TEST( Elimination_DHP_5ms ) \
typedef cds::intrusive::TreiberStack< cds::gc::HP, T > Treiber_HP;
struct traits_Treiber_DHP: public
cds::intrusive::treiber_stack::make_traits <
- cds::intrusive::opt::hook< base_hook<cds::gc::PTB> >
+ cds::intrusive::opt::hook< base_hook<cds::gc::DHP> >
> ::type
{};
- typedef cds::intrusive::TreiberStack< cds::gc::PTB, T, traits_Treiber_DHP >Treiber_PTB;
+ typedef cds::intrusive::TreiberStack< cds::gc::DHP, T, traits_Treiber_DHP >Treiber_DHP;
template <class GC> struct traits_Treiber_seqcst : public
cds::intrusive::treiber_stack::make_traits <
typedef cds::intrusive::TreiberStack< cds::gc::HP, T, traits_Elimination_on<cds::gc::HP> > Elimination_HP;
typedef cds::intrusive::TreiberStack< cds::gc::DHP, T, traits_Elimination_on<cds::gc::DHP> > Elimination_DHP;
+ template <class GC> struct traits_Elimination_seqcst : public
+ cds::intrusive::treiber_stack::make_traits <
+ cds::intrusive::opt::hook< base_hook<GC> >
+ , cds::opt::enable_elimination<true>
+ , cds::opt::memory_model< cds::opt::v::sequential_consistent >
+ > ::type
+ {};
+ typedef cds::intrusive::TreiberStack< cds::gc::HP, T, traits_Elimination_seqcst<cds::gc::HP> > Elimination_HP_seqcst;
+ typedef cds::intrusive::TreiberStack< cds::gc::DHP, T, traits_Elimination_seqcst<cds::gc::DHP> > Elimination_DHP_seqcst;
+
template <class GC> struct traits_Elimination_2ms: public
cds::intrusive::treiber_stack::make_traits <
cds::intrusive::opt::hook< base_hook<GC> >
> ::type
{};
typedef cds::container::TreiberStack< cds::gc::HP, T, traits_Elimination_2ms > Elimination_HP_2ms;
- typedef cds::container::TreiberStack< cds::gc::DHP, T, traits_Elimination_2ms > Elimination_HP_2ms;
+ typedef cds::container::TreiberStack< cds::gc::DHP, T, traits_Elimination_2ms > Elimination_DHP_2ms;
struct traits_Elimination_2ms_stat : public
cds::container::treiber_stack::make_traits <
, cds::opt::stat<cds::intrusive::treiber_stack::stat<> >
> ::type
{};
- typedef cds::container::TreiberStack< cds::gc::HP, T, traits_Elimination_10ms_stat > Elimination_HP_10ms;
- typedef cds::container::TreiberStack< cds::gc::DHP, T, traits_Elimination_10ms_stat > Elimination_DHP_10ms;
+ typedef cds::container::TreiberStack< cds::gc::HP, T, traits_Elimination_10ms_stat > Elimination_HP_10ms_stat;
+ typedef cds::container::TreiberStack< cds::gc::DHP, T, traits_Elimination_10ms_stat > Elimination_DHP_10ms_stat;
struct traits_Elimination_dyn: public
cds::container::treiber_stack::make_traits <