*/
typedef opt::v::relaxed_ordering memory_model;
- /// Alignment for internal queue data. Default is \p opt::cache_line_alignment
- enum { alignment = opt::cache_line_alignment };
+ /// Padding for internal critical atomic data. Default is \p opt::cache_line_padding
+ enum { padding = opt::cache_line_padding };
};
/// Metafunction converting option list to \p tsigas_queue::traits
- \p opt::back_off - back-off strategy used, default is \p cds::backoff::empty.
- \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
- - \p opt::alignment - the alignment for internal queue data. Default is \p opt::cache_line_alignment
+ - \p opt::padding - padding for internal critical atomic data. Default is \p opt::cache_line_padding
- \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).
typedef cds::container::TsigasCycleQueue< Foo,
typename cds::container::tsigas_queue::make_traits<
cds::opt::buffer< cds::opt::v::static_buffer< void *, 1024 >,
- cds::opt::item_counte< cds::atomicity::item_counter >
+ cds::opt::item_counter< cds::atomicity::item_counter >
>::type
> myQueue;
\endcode
*/
typedef opt::v::relaxed_ordering memory_model;
- /// Alignment for internal queue data. Default is \p opt::cache_line_alignment
- enum { alignment = opt::cache_line_alignment };
+ /// Padding for internal critical atomic data. Default is \p opt::cache_line_padding
+ enum { padding = opt::cache_line_padding };
};
/// Metafunction converting option list to \p tsigas_queue::traits
when dequeuing.
- \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
- - \p opt::alignment - the alignment for internal queue data. Default is \p opt::cache_line_alignment
+ - \p opt::padding - padding for internal critical atomic data. Default is \p opt::cache_line_padding
- \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).
protected:
//@cond
- typedef typename opt::details::alignment_setter< buffer, traits::alignment >::type aligned_buffer;
typedef size_t index_type;
- typedef typename opt::details::alignment_setter< atomics::atomic<index_type>, traits::alignment >::type aligned_index;
//@endcond
protected:
//@cond
- buffer m_buffer ; ///< array of pointer T *, array size is equal to m_nCapacity+1
- aligned_index m_nHead ; ///< index of queue's head
- aligned_index m_nTail ; ///< index of queue's tail
- item_counter m_ItemCounter ; ///< item counter
+ buffer m_buffer ; ///< array of pointer T *, array size is equal to m_nCapacity+1
+ typename opt::details::apply_padding< index_type, traits::padding >::padding_type pad1_;
+ atomics::atomic<index_type> m_nHead ; ///< index of queue's head
+ typename opt::details::apply_padding< index_type, traits::padding >::padding_type pad2_;
+ atomics::atomic<index_type> m_nTail ; ///< index of queue's tail
+ typename opt::details::apply_padding< index_type, traits::padding >::padding_type pad3_;
+ item_counter m_ItemCounter; ///< item counter
//@endcond
protected:
no_special_padding = 0, ///< no special padding
cache_line_padding = 1, ///< use cache line size defined in cds/user_setup/cache_line.h
- /// Apply padding only for tiny data of size less than required padding
+ /// Apply padding only for tiny data when data size is less than required padding
/**
The flag means that if your data size is less than the casheline size, the padding is applyed.
Otherwise no padding will be applyed.