cds
2.3.2
|
Metafunction converting option list to treiber_stack::traits
.
More...
#include <cds/intrusive/treiber_stack.h>
Public Types | |
typedef implementation_defined | type |
Metafunction result. | |
Metafunction converting option list to treiber_stack::traits
.
Supported Options
are:
opt::hook
- hook used. Possible hooks are: treiber_stack::base_hook
, treiber_stack::member_hook
, treiber_stack::traits_hook
. If the option is not specified, treiber_stack::base_hook<>
is used.opt::back_off
- back-off strategy used. If the option is not specified, the cds::backoff::Default
is used.opt::disposer
- the functor used for dispose removed items. Default is opt::v::empty_disposer
. This option is used only in TreiberStack::clear
function.opt::link_checker
- the type of node's link fields checking. Default is opt::debug_check_link.opt::memory_model
- C++ memory ordering model. Can be opt::v::relaxed_ordering
(relaxed memory model, the default) or opt::v::sequential_consistent
(sequentially consisnent memory model).opt::item_counter
- the type of item counting feature. Default is cds::atomicity::empty_item_counter
, i.e. no item counting. Use cds::atomicity::item_counter
to enable item counting.opt::stat
- the type to gather internal statistics. Possible option value are: treiber_stack::stat
, treiber_stack::empty_stat
(the default), user-provided class that supports treiber_stack::stat
interface.opt::enable_elimination
- enable elimination back-off for the stack. Default value is false
.If elimination back-off is enabled, additional options can be specified:
opt::buffer
- a buffer type for elimination array, see opt::v::initialized_static_buffer
, opt::v::initialized_dynamic_buffer
. The buffer can be any size: Exp2
template parameter of those classes can be false
. The size should be selected empirically for your application and hardware, there are no common rules for that. Default is opt::v::initialized_static_buffer< any_type, 4 >
.opt::random_engine
- a random engine to generate a random position in elimination array. Default is opt::v::c_rand
.opt::elimination_backoff
- back-off strategy to wait for elimination, default is cds::backoff::delay<>
opt::lock_type
- a lock type used in elimination back-off, default is cds::sync::spin
Example: declare TreiberStack
with elimination enabled and internal statistics