template <typename Counter = cds::atomicity::event_counter >
struct stat
{
- typedef Counter counter_type ; ///< Counter type
+ typedef Counter counter_type; ///< Counter type
counter_type m_EnqueueCount ; ///< Enqueue call count
counter_type m_DequeueCount ; ///< Dequeue call count
};
/// Dummy queue statistics - no counting is performed, no overhead. Support interface like \p msqueue::stat
- /** @ingroup cds_intrusive_helper
- */
struct empty_stat
{
//@cond
//@endcond
};
- /// MSQueue default type traits
+ /// MSQueue default traits
struct traits
{
/// Back-off strategy
/// Link checking, see \p cds::opt::link_checker
static CDS_CONSTEXPR const opt::link_check_type link_checker = opt::debug_check_link;
- /// Alignment of internal queue data. Default is \p opt::cache_line_alignment
+ /// Alignment for internal queue data. Default is \p opt::cache_line_alignment
enum { alignment = opt::cache_line_alignment };
};
/// Metafunction converting option list to \p msqueue::traits
/**
- This is a wrapper for <tt> cds::opt::make_options< type_traits, Options...> </tt>
Supported \p Options are:
- - opt::hook - hook used. Possible hooks are: \p msqueue::base_hook, \p msqueue::member_hook, \p msqueue::traits_hook.
+ - \p opt::hook - hook used. Possible hooks are: \p msqueue::base_hook, \p msqueue::member_hook, \p msqueue::traits_hook.
If the option is not specified, \p %msqueue::base_hook<> is used.
- - opt::back_off - back-off strategy used, default is \p cds::backoff::empty.
- - opt::disposer - the functor used for dispose removed items. Default is \p opt::v::empty_disposer. This option is used
+ - \p opt::back_off - back-off strategy used, default is \p cds::backoff::empty.
+ - \p opt::disposer - the functor used for dispose removed items. Default is \p opt::v::empty_disposer. This option is used
when dequeuing.
- - opt::link_checker - the type of node's link fields checking. Default is \p opt::debug_check_link
- - opt::item_counter - the type of item counting feature. Default is \p cds::atomicity::empty_item_counter (item counting disabled)
+ - \p opt::link_checker - the type of node's link fields checking. Default is \p opt::debug_check_link
+ - \p opt::item_counter - the type of item counting feature. Default is \p cds::atomicity::empty_item_counter (item counting disabled)
To enable item counting use \p cds::atomicity::item_counter
- - opt::stat - the type to gather internal statistics.
+ - \p opt::stat - the type to gather internal statistics.
Possible statistics types are: \p msqueue::stat, \p msqueue::empty_stat, user-provided class that supports \p %msqueue::stat interface.
- Default is \p %msqueue::empty_stat.
- - opt::alignment - the alignment for internal queue data. Default is \p opt::cache_line_alignment
- - opt::memory_model - C++ memory ordering model. Can be \p opt::v::relaxed_ordering (relaxed memory model, the default)
+ Default is \p %msqueue::empty_stat (internal statistics disabled).
+ - \p opt::alignment - the alignment for internal queue data. Default is \p opt::cache_line_alignment
+ - \p opt::memory_model - C++ memory ordering model. Can be \p opt::v::relaxed_ordering (relaxed memory model, the default)
or \p opt::v::sequential_consistent (sequentially consisnent memory model).
Example: declare \p %MSQueue with item counting and internal statistics
>::type type;
# endif
};
-
-
} // namespace msqueue
/// Michael & Scott's intrusive lock-free queue
Template arguments:
- \p GC - garbage collector type: \p gc::HP, \p gc::DHP
- - \p T - type to be stored in the queue. A value of type \p T must be derived from \p msqueue::node for \p msqueue::base_hook,
+ - \p T - type of value to be stored in the queue. A value of type \p T must be derived from \p msqueue::node for \p msqueue::base_hook,
or it should have a member of type \p %msqueue::node for \p msqueue::member_hook,
or it should be convertible to \p %msqueue::node for \p msqueue::traits_hook.
- \p Traits - queue traits, default is \p msqueue::traits. You can use \p msqueue::make_traits
{
public:
typedef GC gc; ///< Garbage collector
- typedef T value_type; ///< type of value stored in the queue
+ typedef T value_type; ///< type of value to be stored in the queue
typedef Traits traits; ///< Queue traits
typedef typename traits::hook hook; ///< hook type
typedef MSQueue< GC2, T2, Traits2 > other; ///< Rebinding result
};
+ static CDS_CONSTEXPR const size_t m_nHazardPtrCount = 2; ///< Count of hazard pointer required for the algorithm
+
protected:
//@cond