*/
typedef opt::v::relaxed_ordering memory_model;
- /// Alignment of 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 basket_queue::traits
/**
Supported \p Options are:
- - opt::allocator - allocator (like \p std::allocator) used for allocating queue nodes. Default is \ref CDS_DEFAULT_ALLOCATOR
- - opt::back_off - back-off strategy used, default is \p cds::backoff::empty.
- - opt::item_counter - the type of item counting feature. Default is \p cds::atomicity::empty_item_counter (item counting disabled)
+ - \p opt::allocator - allocator (like \p std::allocator) used for allocating queue nodes. Default is \ref CDS_DEFAULT_ALLOCATOR
+ - \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
- - opt::stat - the type to gather internal statistics.
+ - \ opt::stat - the type to gather internal statistics.
Possible statistics types are: \p basket_queue::stat, \p basket_queue::empty_stat, user-provided class that supports \p %basket_queue::stat interface.
Default is \p %basket_queue::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)
+ - \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).
Example: declare \p %BasketQueue with item counting and internal statistics
*/
typedef opt::v::relaxed_ordering memory_model;
- /// Alignment of 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 msqueue::traits
- \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.
- - \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).
/// Link checking, see \p cds::opt::link_checker
static CDS_CONSTEXPR const opt::link_check_type link_checker = opt::debug_check_link;
- /// 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 };
};
- opt::stat - the type to gather internal statistics.
Possible statistics types are: \p basket_queue::stat, \p basket_queue::empty_stat, user-provided class that supports \p %basket_queue::stat interface.
Default is \p %basket_queue::empty_stat (internal statistics disabled).
- - 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
- 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).
// BasketQueue with Hazard Pointer garbage collector,
// member hook + item disposer + item counter,
- // without alignment of internal queue data:
+ // without padding of internal queue data:
struct Bar
{
// Your data
>
,ci::opt::disposer< fooDisposer >
,cds::opt::item_counter< cds::atomicity::item_counter >
- ,cds::opt::alignment< cds::opt::no_special_alignment >
+ ,cds::opt::padding< cds::opt::no_special_padding >
>::type
{};
typedef ci::BasketQueue< hp_gc, Bar, barTraits > barQueue;
typedef typename node_type::marked_ptr marked_ptr;
typedef typename node_type::atomic_marked_ptr atomic_marked_ptr;
- typedef typename opt::details::alignment_setter< atomic_marked_ptr, traits::alignment >::type aligned_node_ptr;
- typedef typename opt::details::alignment_setter< node_type, traits::alignment >::type dummy_node_type;
-
// 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");
//@endcond
- aligned_node_ptr m_pHead ; ///< Queue's head pointer (aligned)
- aligned_node_ptr m_pTail ; ///< Queue's tail pointer (aligned)
- dummy_node_type m_Dummy ; ///< dummy node
+ atomic_marked_ptr m_pHead ; ///< Queue's head pointer (aligned)
+ typename opt::details::apply_padding< atomic_marked_ptr, traits::padding >::padding_type pad1_;
+ atomic_marked_ptr m_pTail ; ///< Queue's tail pointer (aligned)
+ typename opt::details::apply_padding< atomic_marked_ptr, traits::padding >::padding_type pad2_;
+ node_type m_Dummy ; ///< dummy node
+ typename opt::details::apply_padding< node_type, traits::padding >::padding_type pad3_;
item_counter m_ItemCounter ; ///< Item counter
stat m_Stat ; ///< Internal statistics
//@cond
atomic_node_ptr m_pNext ; ///< pointer to the next node in the container
- node()
- : m_pNext( nullptr )
- {}
+ node() CDS_NOEXCEPT
+ {
+ m_pNext.store( nullptr, atomics::memory_order_release );
+ }
};
//@cond
// MoirQueue with Hazard Pointer garbage collector,
// member hook + item disposer + item counter,
- // without alignment of internal queue data:
+ // without padding of internal queue data:
struct Bar
{
// Your data
typedef ci::msqueue::member_hook< offsetof(Bar, hMember), ,ci::opt::gc<hp_gc> > hook;
typedef fooDisposer disposer;
typedef cds::atomicity::item_counter item_counter;
- enum { aligment = cds::opt::no_special_alignment alignment };
+ enum { padding = cds::opt::no_special_padding };
};
typedef ci::MoirQueue< hp_gc, Bar, barQueueTraits > barQueue;
\endcode
/// Link checking, see \p cds::opt::link_checker
static CDS_CONSTEXPR const opt::link_check_type link_checker = opt::debug_check_link;
- /// 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 msqueue::traits
- \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 (internal statistics disabled).
- - \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).
// Example 2:
// MSQueue with Hazard Pointer garbage collector,
// member hook + item disposer + item counter,
- // without alignment of internal queue data
+ // without padding of internal queue data
// Use msqueue::make_traits
struct Bar
{
>
,ci::opt::disposer< fooDisposer >
,cds::opt::item_counter< cds::atomicity::item_counter >
- ,cds::opt::alignment< cds::opt::no_special_alignment >
+ ,cds::opt::padding< cds::opt::no_special_padding >
>::type
> barQueue;
\endcode
// 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");
- typedef typename opt::details::alignment_setter< typename node_type::atomic_node_ptr, traits::alignment >::type aligned_node_ptr;
- typedef typename opt::details::alignment_setter< node_type, traits::alignment >::type dummy_node_type;
+ typedef typename node_type::atomic_node_ptr atomic_node_ptr;
- aligned_node_ptr m_pHead ; ///< Queue's head pointer
- aligned_node_ptr m_pTail ; ///< Queue's tail pointer
- dummy_node_type m_Dummy ; ///< dummy node
- item_counter m_ItemCounter ; ///< Item counter
- stat m_Stat ; ///< Internal statistics
+ atomic_node_ptr m_pHead; ///< Queue's head pointer
+ typename opt::details::apply_padding< atomic_node_ptr, traits::padding >::padding_type pad1_;
+ atomic_node_ptr m_pTail; ///< Queue's tail pointer
+ typename opt::details::apply_padding< atomic_node_ptr, traits::padding >::padding_type pad2_;
+ node_type m_Dummy; ///< dummy node
+ typename opt::details::apply_padding< node_type, traits::padding >::padding_type pad3_;
+ item_counter m_ItemCounter; ///< Item counter
+ stat m_Stat; ///< Internal statistics
//@endcond
//@cond
bool empty() const
{
typename gc::Guard guard;
- return guard.protect( m_pHead, []( node_type * p ) -> value_type * { return node_traits::to_value_ptr( p );})
- ->m_pNext.load( memory_model::memory_order_relaxed ) == nullptr;
+ node_type * p = guard.protect( m_pHead, []( node_type * p ) -> value_type * { return node_traits::to_value_ptr( p );});
+ return p->m_pNext.load( memory_model::memory_order_relaxed ) == nullptr;
}
/// Clear the queue
atomic_node_ptr m_pPrev ; ///< Pointer to previous node
atomic_node_ptr m_pNext ; ///< Pointer to next node
- CDS_CONSTEXPR node() CDS_NOEXCEPT
- : m_pPrev( nullptr )
- , m_pNext( nullptr )
- {}
+ node() CDS_NOEXCEPT
+ {
+ m_pPrev.store( nullptr, atomics::memory_order_release );
+ m_pNext.store( nullptr, atomics::memory_order_release );
+ }
};
//@cond
assert( pHead != nullptr );
pFirstNodePrev = res.guards.protect( 2, pHead->m_pPrev, [](node_type * p) -> value_type * {return node_traits::to_value_ptr(p);});
- if ( pHead == m_pHead.load(memory_model::memory_order_relaxed)) {
+ if ( pHead == m_pHead.load(memory_model::memory_order_acquire)) {
if ( pTail != pHead ) {
if ( pFirstNodePrev == nullptr
- || pFirstNodePrev->m_pNext.load(memory_model::memory_order_relaxed) != pHead )
+ || pFirstNodePrev->m_pNext.load(memory_model::memory_order_acquire) != pHead )
{
fix_list( pTail, pHead );
continue;
pCurNode = pTail;
while ( pCurNode != pHead ) { // While not at head
- pCurNodeNext = guards.protect(0, pCurNode->m_pNext, [](node_type * p) -> value_type * {return node_traits::to_value_ptr(p);} );
- if ( pHead != m_pHead.load(memory_model::memory_order_relaxed) )
+ pCurNodeNext = guards.protect(0, pCurNode->m_pNext, [](node_type * p) -> value_type * { return node_traits::to_value_ptr(p);});
+ if ( pHead != m_pHead.load(memory_model::memory_order_acquire))
break;
pCurNodeNext->m_pPrev.store( pCurNode, memory_model::memory_order_release );
guards.assign( 1, node_traits::to_value_ptr( pCurNode = pCurNodeNext ));
struct alignment_setter<Type, cache_line_alignment> {
typedef typename cds::details::aligned_type< Type, c_nCacheLineSize >::type type;
};
-
} // namespace details
//@endcond
struct type {
T data;
};
+ typedef void padding_type;
};
template <typename T, unsigned int Padding, bool TinyOnly >
struct type {
T data;
};
+ typedef void padding_type;
};
template <typename T, unsigned int Padding, bool TinyOnly >
struct apply_padding_helper < T, Padding, false, padding_datasize_less, TinyOnly >
{
+ typedef uint8_t padding_type[Padding - sizeof( T )];
struct type {
T data;
- uint8_t pad_[Padding - sizeof( T )];
+ padding_type pad_;
};
+
};
template <typename T, unsigned int Padding >
struct apply_padding_helper < T, Padding, false, padding_datasize_greater, false >
{
+ typedef uint8_t padding_type[Padding - sizeof( T ) % Padding];
struct type {
T data;
- uint8_t pad_[Padding - sizeof( T ) % Padding];
+ padding_type pad_;
};
};
struct type {
T data;
};
+ typedef void padding_type;
};
template <typename T, unsigned int Padding >
static_assert( (c_nPadding & (c_nPadding - 1)) == 0, "Padding must be a power-of-two number" );
- typedef typename apply_padding_helper< T,
+ typedef apply_padding_helper< T,
c_nPadding,
c_nPadding == 0,
sizeof( T ) < c_nPadding ? padding_datasize_less : sizeof( T ) == c_nPadding ? padding_datasize_equal : padding_datasize_greater,
(Padding & padding_tiny_data_only) != 0
- >::type type;
+ > result;
+
+ typedef typename result::type type;
+
+ typedef typename std::conditional<
+ std::is_same< typename result::padding_type, void >::value,
+ unsigned int,
+ typename result::padding_type
+ >::type padding_type;
};
} // namespace details
typedef cds::container::BasketQueue < cds::gc::DHP, int,
typename cds::container::basket_queue::make_traits <
cds::opt::memory_model< cds::opt::v::relaxed_ordering>
- ,cds::opt::alignment< 16 >
+ ,cds::opt::padding< 16 >
>::type
> queue_type;
test_no_ic< queue_type >();
{
typedef cds::atomicity::item_counter item_counter;
typedef cds::opt::v::relaxed_ordering memory_model;
- enum { alignment = 32 };
+ enum { padding = 32 };
};
typedef cds::container::BasketQueue < cds::gc::DHP, int, traits > queue_type;
test_ic< queue_type >();
typedef cds::container::BasketQueue < cds::gc::DHP, int,
typename cds::container::basket_queue::make_traits <
cds::opt::memory_model< cds::opt::v::sequential_consistent>
- , cds::opt::alignment< cds::opt::no_special_alignment >
+ , cds::opt::padding< cds::opt::no_special_padding >
> ::type
> queue_type;
test_no_ic< queue_type >();
typename cds::container::basket_queue::make_traits <
cds::opt::item_counter< cds::atomicity::item_counter >
,cds::opt::memory_model< cds::opt::v::sequential_consistent>
- ,cds::opt::alignment< cds::opt::cache_line_alignment >
+ ,cds::opt::padding< cds::opt::cache_line_padding >
> ::type
> queue_type;
test_ic< queue_type >();
typedef cds::container::BasketQueue < cds::gc::HP, int,
typename cds::container::basket_queue::make_traits <
cds::opt::memory_model< cds::opt::v::relaxed_ordering>
- ,cds::opt::alignment< 16 >
+ ,cds::opt::padding< 16 >
>::type
> queue_type;
test_no_ic< queue_type >();
{
typedef cds::atomicity::item_counter item_counter;
typedef cds::opt::v::relaxed_ordering memory_model;
- enum { alignment = 32 };
+ enum { padding = 32 };
};
typedef cds::container::BasketQueue < cds::gc::HP, int, traits > queue_type;
test_ic< queue_type >();
typedef cds::container::BasketQueue < cds::gc::HP, int,
typename cds::container::basket_queue::make_traits <
cds::opt::memory_model< cds::opt::v::sequential_consistent>
- , cds::opt::alignment< cds::opt::no_special_alignment >
+ , cds::opt::padding< cds::opt::no_special_padding >
> ::type
> queue_type;
test_no_ic< queue_type >();
typename cds::container::basket_queue::make_traits <
cds::opt::item_counter< cds::atomicity::item_counter >
,cds::opt::memory_model< cds::opt::v::sequential_consistent>
- ,cds::opt::alignment< cds::opt::cache_line_alignment >
+ ,cds::opt::padding< cds::opt::cache_line_padding >
> ::type
> queue_type;
test_ic< queue_type >();
>::type
> BasketQueue_DHP_member_stat;
- // DHP base hook + alignment
+ // DHP base hook + padding
typedef ci::BasketQueue< cds::gc::DHP, base_hook_item,
typename ci::basket_queue::make_traits<
ci::opt::disposer< IntrusiveQueueHeaderTest::faked_disposer >
,ci::opt::hook<
ci::basket_queue::base_hook< ci::opt::gc<cds::gc::DHP> >
>
- ,co::alignment< 32 >
+ ,co::padding< 32 >
>::type
> BasketQueue_DHP_base_align;
- // DHP member hook + alignment
+ // DHP member hook + padding
typedef ci::BasketQueue< cds::gc::DHP, member_hook_item,
typename ci::basket_queue::make_traits<
ci::opt::hook<
ci::opt::gc<cds::gc::DHP>
>
>
- ,co::alignment< 32 >
+ ,co::padding< 32 >
,ci::opt::disposer< IntrusiveQueueHeaderTest::faked_disposer >
>::type
> BasketQueue_DHP_member_align;
- // DHP base hook + no alignment
+ // DHP base hook + no padding
typedef ci::BasketQueue< cds::gc::DHP, base_hook_item,
typename ci::basket_queue::make_traits<
ci::opt::hook<
ci::basket_queue::base_hook< ci::opt::gc<cds::gc::DHP> >
>
,ci::opt::disposer< IntrusiveQueueHeaderTest::faked_disposer >
- ,co::alignment< co::no_special_alignment >
+ ,co::padding< co::no_special_padding >
>::type
> BasketQueue_DHP_base_noalign;
- // DHP member hook + no alignment
+ // DHP member hook + no padding
typedef ci::BasketQueue< cds::gc::DHP, member_hook_item,
typename ci::basket_queue::make_traits<
ci::opt::disposer< IntrusiveQueueHeaderTest::faked_disposer >
ci::opt::gc<cds::gc::DHP>
>
>
- ,co::alignment< co::no_special_alignment >
+ ,co::padding< co::no_special_padding >
>::type
> BasketQueue_DHP_member_noalign;
- // DHP base hook + cache alignment
+ // DHP base hook + cache padding
typedef ci::BasketQueue< cds::gc::DHP, base_hook_item,
typename ci::basket_queue::make_traits<
ci::opt::hook<
ci::basket_queue::base_hook< ci::opt::gc<cds::gc::DHP> >
>
- ,co::alignment< co::cache_line_alignment >
+ ,co::padding< co::cache_line_padding >
,ci::opt::disposer< IntrusiveQueueHeaderTest::faked_disposer >
>::type
> BasketQueue_DHP_base_cachealign;
- // DHP member hook + cache alignment
+ // DHP member hook + cache padding
typedef ci::BasketQueue< cds::gc::DHP, member_hook_item,
typename ci::basket_queue::make_traits<
ci::opt::hook<
ci::opt::gc<cds::gc::DHP>
>
>
- ,co::alignment< co::cache_line_alignment >
+ ,co::padding< co::cache_line_padding >
,ci::opt::disposer< IntrusiveQueueHeaderTest::faked_disposer >
>::type
> BasketQueue_DHP_member_cachealign;
>::type
> BasketQueue_HP_member_stat;
- // HP base hook + alignment
+ // HP base hook + padding
typedef ci::BasketQueue< cds::gc::HP, base_hook_item,
typename ci::basket_queue::make_traits<
ci::opt::disposer< IntrusiveQueueHeaderTest::faked_disposer >
,ci::opt::hook<
ci::basket_queue::base_hook< ci::opt::gc<cds::gc::HP> >
>
- ,co::alignment< 32 >
+ ,co::padding< 32 >
>::type
> BasketQueue_HP_base_align;
- // HP member hook + alignment
+ // HP member hook + padding
typedef ci::BasketQueue< cds::gc::HP, member_hook_item,
typename ci::basket_queue::make_traits<
ci::opt::hook<
ci::opt::gc<cds::gc::HP>
>
>
- ,co::alignment< 32 >
+ ,co::padding< 32 >
,ci::opt::disposer< IntrusiveQueueHeaderTest::faked_disposer >
>::type
> BasketQueue_HP_member_align;
- // HP base hook + no alignment
+ // HP base hook + no padding
typedef ci::BasketQueue< cds::gc::HP, base_hook_item,
typename ci::basket_queue::make_traits<
ci::opt::hook<
ci::basket_queue::base_hook< ci::opt::gc<cds::gc::HP> >
>
,ci::opt::disposer< IntrusiveQueueHeaderTest::faked_disposer >
- ,co::alignment< co::no_special_alignment >
+ ,co::padding< co::no_special_padding >
>::type
> BasketQueue_HP_base_noalign;
- // HP member hook + no alignment
+ // HP member hook + no padding
typedef ci::BasketQueue< cds::gc::HP, member_hook_item,
typename ci::basket_queue::make_traits<
ci::opt::disposer< IntrusiveQueueHeaderTest::faked_disposer >
ci::opt::gc<cds::gc::HP>
>
>
- ,co::alignment< co::no_special_alignment >
+ ,co::padding< co::no_special_padding >
>::type
> BasketQueue_HP_member_noalign;
- // HP base hook + cache alignment
+ // HP base hook + cache padding
typedef ci::BasketQueue< cds::gc::HP, base_hook_item,
typename ci::basket_queue::make_traits<
ci::opt::hook<
ci::basket_queue::base_hook< ci::opt::gc<cds::gc::HP> >
>
- ,co::alignment< co::cache_line_alignment >
+ ,co::padding< co::cache_line_padding >
,ci::opt::disposer< IntrusiveQueueHeaderTest::faked_disposer >
>::type
> BasketQueue_HP_base_cachealign;
- // HP member hook + cache alignment
+ // HP member hook + cache padding
typedef ci::BasketQueue< cds::gc::HP, member_hook_item,
typename ci::basket_queue::make_traits<
ci::opt::hook<
ci::opt::gc<cds::gc::HP>
>
>
- ,co::alignment< co::cache_line_alignment >
+ ,co::padding< co::cache_line_padding >
,ci::opt::disposer< IntrusiveQueueHeaderTest::faked_disposer >
>::type
> BasketQueue_HP_member_cachealign;
>::type
> MoirQueue_DHP_member_stat;
- // DHP base hook + alignment
+ // DHP base hook + padding
typedef ci::MoirQueue< cds::gc::DHP, base_item_type,
typename ci::msqueue::make_traits<
ci::opt::disposer< IntrusiveQueueHeaderTest::faked_disposer >
, ci::opt::hook<
ci::msqueue::base_hook< ci::opt::gc<cds::gc::DHP> >
>
- , co::alignment< 32 >
+ , co::padding< 32 >
>::type
> MoirQueue_DHP_base_align;
- // DHP member hook + alignment
+ // DHP member hook + padding
typedef ci::MoirQueue< cds::gc::DHP, member_item_type,
typename ci::msqueue::make_traits<
ci::opt::hook<
ci::opt::gc<cds::gc::DHP>
>
>
- , co::alignment< 32 >
+ , co::padding< 32 >
, ci::opt::disposer< IntrusiveQueueHeaderTest::faked_disposer >
>::type
> MoirQueue_DHP_member_align;
- // DHP base hook + no alignment
+ // DHP base hook + no padding
struct traits_MoirQueue_DHP_base_noalign : public ci::msqueue::traits {
typedef ci::msqueue::base_hook< ci::opt::gc<cds::gc::DHP> > hook;
typedef IntrusiveQueueHeaderTest::faked_disposer disposer;
- enum { alignment = co::no_special_alignment };
+ enum { padding = co::no_special_padding };
};
typedef ci::MoirQueue< cds::gc::DHP, base_item_type, traits_MoirQueue_DHP_base_noalign > MoirQueue_DHP_base_noalign;
- // DHP member hook + no alignment
+ // DHP member hook + no padding
struct traits_MoirQueue_DHP_member_noalign : public ci::msqueue::traits {
typedef ci::msqueue::member_hook <
offsetof( member_item_type, hMember ),
ci::opt::gc < cds::gc::DHP >
> hook;
typedef IntrusiveQueueHeaderTest::faked_disposer disposer;
- enum { alignment = co::no_special_alignment };
+ enum { padding = co::no_special_padding };
};
typedef ci::MoirQueue< cds::gc::DHP, member_item_type, traits_MoirQueue_DHP_member_noalign > MoirQueue_DHP_member_noalign;
- // DHP base hook + cache alignment
+ // DHP base hook + cache padding
struct traits_MoirQueue_DHP_base_cachealign : public traits_MoirQueue_DHP_base_noalign
{
- enum { alignment = co::cache_line_alignment };
+ enum { padding = co::cache_line_padding };
};
typedef ci::MoirQueue< cds::gc::DHP, base_item_type, traits_MoirQueue_DHP_base_cachealign > MoirQueue_DHP_base_cachealign;
- // DHP member hook + cache alignment
+ // DHP member hook + cache padding
struct traits_MoirQueue_DHP_member_cachealign : public traits_MoirQueue_DHP_member_noalign
{
- enum { alignment = co::cache_line_alignment };
+ enum { padding = co::cache_line_padding };
};
typedef ci::MoirQueue< cds::gc::DHP, member_item_type, traits_MoirQueue_DHP_member_cachealign > MoirQueue_DHP_member_cachealign;
} // namespace
>::type
> MoirQueue_HP_member_stat;
- // HP base hook + alignment
+ // HP base hook + padding
typedef ci::MoirQueue< cds::gc::HP, base_item_type,
typename ci::msqueue::make_traits<
ci::opt::disposer< IntrusiveQueueHeaderTest::faked_disposer >
,ci::opt::hook<
ci::msqueue::base_hook< ci::opt::gc<cds::gc::HP> >
>
- ,co::alignment< 32 >
+ ,co::padding< 32 >
>::type
> MoirQueue_HP_base_align;
- // HP member hook + alignment
+ // HP member hook + padding
typedef ci::MoirQueue< cds::gc::HP, member_item_type,
typename ci::msqueue::make_traits<
ci::opt::hook<
ci::opt::gc<cds::gc::HP>
>
>
- ,co::alignment< 32 >
+ ,co::padding< 32 >
,ci::opt::disposer< IntrusiveQueueHeaderTest::faked_disposer >
>::type
> MoirQueue_HP_member_align;
- // HP base hook + no alignment
+ // HP base hook + no padding
struct traits_MoirQueue_HP_base_noalign : public ci::msqueue::traits {
typedef ci::msqueue::base_hook< ci::opt::gc<cds::gc::HP> > hook;
typedef IntrusiveQueueHeaderTest::faked_disposer disposer;
- enum { alignment = co::no_special_alignment };
+ enum { padding = co::no_special_padding };
};
typedef ci::MoirQueue< cds::gc::HP, base_item_type, traits_MoirQueue_HP_base_noalign > MoirQueue_HP_base_noalign;
- // HP member hook + no alignment
+ // HP member hook + no padding
struct traits_MoirQueue_HP_member_noalign : public ci::msqueue::traits {
typedef ci::msqueue::member_hook <
offsetof( member_item_type, hMember ),
ci::opt::gc < cds::gc::HP >
> hook;
typedef IntrusiveQueueHeaderTest::faked_disposer disposer;
- enum { alignment = co::no_special_alignment };
+ enum { padding = co::no_special_padding };
};
typedef ci::MoirQueue< cds::gc::HP, member_item_type, traits_MoirQueue_HP_member_noalign > MoirQueue_HP_member_noalign;
- // HP base hook + cache alignment
+ // HP base hook + cache padding
struct traits_MoirQueue_HP_base_cachealign : public traits_MoirQueue_HP_base_noalign
{
- enum { alignment = co::cache_line_alignment };
+ enum { padding = co::cache_line_padding };
};
typedef ci::MoirQueue< cds::gc::HP, base_item_type, traits_MoirQueue_HP_base_cachealign > MoirQueue_HP_base_cachealign;
- // HP member hook + cache alignment
+ // HP member hook + cache padding
struct traits_MoirQueue_HP_member_cachealign : public traits_MoirQueue_HP_member_noalign
{
- enum { alignment = co::cache_line_alignment };
+ enum { padding = co::cache_line_padding };
};
typedef ci::MoirQueue< cds::gc::HP, member_item_type, traits_MoirQueue_HP_member_cachealign > MoirQueue_HP_member_cachealign;
}
>::type
> MSQueue_DHP_member_stat;
- // DHP base hook + alignment
+ // DHP base hook + padding
typedef ci::MSQueue< cds::gc::DHP, base_item_type,
typename ci::msqueue::make_traits<
ci::opt::disposer< IntrusiveQueueHeaderTest::faked_disposer >
, ci::opt::hook<
ci::msqueue::base_hook< ci::opt::gc<cds::gc::DHP> >
>
- , co::alignment< 32 >
+ , co::padding< 32 >
>::type
> MSQueue_DHP_base_align;
- // DHP member hook + alignment
+ // DHP member hook + padding
typedef ci::MSQueue< cds::gc::DHP, member_item_type,
typename ci::msqueue::make_traits<
ci::opt::hook<
ci::opt::gc<cds::gc::DHP>
>
>
- , co::alignment< 32 >
+ , co::padding< 32 >
, ci::opt::disposer< IntrusiveQueueHeaderTest::faked_disposer >
>::type
> MSQueue_DHP_member_align;
- // DHP base hook + no alignment
+ // DHP base hook + no padding
struct traits_MSQueue_DHP_base_noalign : public ci::msqueue::traits {
typedef ci::msqueue::base_hook< ci::opt::gc<cds::gc::DHP> > hook;
typedef IntrusiveQueueHeaderTest::faked_disposer disposer;
- enum { alignment = co::no_special_alignment };
+ enum { padding = co::no_special_padding };
};
typedef ci::MSQueue< cds::gc::DHP, base_item_type, traits_MSQueue_DHP_base_noalign > MSQueue_DHP_base_noalign;
- // DHP member hook + no alignment
+ // DHP member hook + no padding
struct traits_MSQueue_DHP_member_noalign : public ci::msqueue::traits {
typedef ci::msqueue::member_hook <
offsetof( member_item_type, hMember ),
ci::opt::gc < cds::gc::DHP >
> hook;
typedef IntrusiveQueueHeaderTest::faked_disposer disposer;
- enum { alignment = co::no_special_alignment };
+ enum { padding = co::no_special_padding };
};
typedef ci::MSQueue< cds::gc::DHP, member_item_type, traits_MSQueue_DHP_member_noalign > MSQueue_DHP_member_noalign;
- // DHP base hook + cache alignment
+ // DHP base hook + cache padding
struct traits_MSQueue_DHP_base_cachealign : public traits_MSQueue_DHP_base_noalign
{
- enum { alignment = co::cache_line_alignment };
+ enum { padding = co::cache_line_padding };
};
typedef ci::MSQueue< cds::gc::DHP, base_item_type, traits_MSQueue_DHP_base_cachealign > MSQueue_DHP_base_cachealign;
- // DHP member hook + cache alignment
+ // DHP member hook + cache padding
struct traits_MSQueue_DHP_member_cachealign : public traits_MSQueue_DHP_member_noalign
{
- enum { alignment = co::cache_line_alignment };
+ enum { padding = co::cache_line_padding };
};
typedef ci::MSQueue< cds::gc::DHP, member_item_type, traits_MSQueue_DHP_member_cachealign > MSQueue_DHP_member_cachealign;
} // namespace
>::type
> MSQueue_HP_member_stat;
- // HP base hook + alignment
+ // HP base hook + padding
typedef ci::MSQueue< cds::gc::HP, base_item_type,
typename ci::msqueue::make_traits<
ci::opt::disposer< IntrusiveQueueHeaderTest::faked_disposer >
,ci::opt::hook<
ci::msqueue::base_hook< ci::opt::gc<cds::gc::HP> >
>
- ,co::alignment< 32 >
+ ,co::padding< 32 >
>::type
> MSQueue_HP_base_align;
- // HP member hook + alignment
+ // HP member hook + padding
typedef ci::MSQueue< cds::gc::HP, member_item_type,
typename ci::msqueue::make_traits<
ci::opt::hook<
ci::opt::gc<cds::gc::HP>
>
>
- ,co::alignment< 32 >
+ ,co::padding< 32 >
,ci::opt::disposer< IntrusiveQueueHeaderTest::faked_disposer >
>::type
> MSQueue_HP_member_align;
- // HP base hook + no alignment
+ // HP base hook + no padding
struct traits_MSQueue_HP_base_noalign : public ci::msqueue::traits {
typedef ci::msqueue::base_hook< ci::opt::gc<cds::gc::HP> > hook;
typedef IntrusiveQueueHeaderTest::faked_disposer disposer;
- enum { alignment = co::no_special_alignment };
+ enum { padding = co::no_special_padding };
};
typedef ci::MSQueue< cds::gc::HP, base_item_type, traits_MSQueue_HP_base_noalign > MSQueue_HP_base_noalign;
- // HP member hook + no alignment
+ // HP member hook + no padding
struct traits_MSQueue_HP_member_noalign : public ci::msqueue::traits {
typedef ci::msqueue::member_hook <
offsetof( member_item_type, hMember ),
ci::opt::gc < cds::gc::HP >
> hook;
typedef IntrusiveQueueHeaderTest::faked_disposer disposer;
- enum { alignment = co::no_special_alignment };
+ enum { padding = co::no_special_padding };
};
typedef ci::MSQueue< cds::gc::HP, member_item_type, traits_MSQueue_HP_member_noalign > MSQueue_HP_member_noalign;
- // HP base hook + cache alignment
+ // HP base hook + cache padding
struct traits_MSQueue_HP_base_cachealign : public traits_MSQueue_HP_base_noalign
{
- enum { alignment = co::cache_line_alignment };
+ enum { padding = co::cache_line_padding };
};
typedef ci::MSQueue< cds::gc::HP, base_item_type, traits_MSQueue_HP_base_cachealign > MSQueue_HP_base_cachealign;
- // HP member hook + cache alignment
+ // HP member hook + cache padding
struct traits_MSQueue_HP_member_cachealign : public traits_MSQueue_HP_member_noalign
{
- enum { alignment = co::cache_line_alignment };
+ enum { padding = co::cache_line_padding };
};
typedef ci::MSQueue< cds::gc::HP, member_item_type, traits_MSQueue_HP_member_cachealign > MSQueue_HP_member_cachealign;
typedef cds::container::MoirQueue < cds::gc::DHP, int,
typename cds::container::msqueue::make_traits <
cds::opt::memory_model< cds::opt::v::relaxed_ordering>
- , cds::opt::alignment < 16 >
+ , cds::opt::padding < 16 >
> ::type
> test_queue;
typename cds::container::msqueue::make_traits <
cds::opt::item_counter< cds::atomicity::item_counter >
, cds::opt::memory_model< cds::opt::v::relaxed_ordering>
- , cds::opt::alignment < 32 >
+ , cds::opt::padding < 32 >
>::type
> test_queue;
typedef cds::container::MoirQueue < cds::gc::DHP, int,
typename cds::container::msqueue::make_traits <
cds::opt::memory_model< cds::opt::v::sequential_consistent>
- ,cds::opt::alignment < cds::opt::no_special_alignment >
+ ,cds::opt::padding < cds::opt::no_special_padding >
> ::type
> test_queue;
typename cds::container::msqueue::make_traits <
cds::opt::item_counter< cds::atomicity::item_counter >
, cds::opt::memory_model< cds::opt::v::sequential_consistent>
- , cds::opt::alignment < cds::opt::cache_line_alignment >
+ , cds::opt::padding < cds::opt::cache_line_padding >
> ::type
> test_queue;
test_ic< test_queue >();
typedef cds::container::MoirQueue < cds::gc::HP, int,
typename cds::container::msqueue::make_traits <
cds::opt::memory_model< cds::opt::v::relaxed_ordering>
- , cds::opt::alignment < 16 >
+ , cds::opt::padding < 16 >
> ::type
> test_queue;
typename cds::container::msqueue::make_traits <
cds::opt::item_counter< cds::atomicity::item_counter >
, cds::opt::memory_model< cds::opt::v::relaxed_ordering>
- , cds::opt::alignment < 32 >
+ , cds::opt::padding < 32 >
>::type
> test_queue;
typedef cds::container::MoirQueue < cds::gc::HP, int,
typename cds::container::msqueue::make_traits <
cds::opt::memory_model< cds::opt::v::sequential_consistent>
- ,cds::opt::alignment < cds::opt::no_special_alignment >
+ ,cds::opt::padding < cds::opt::no_special_padding >
> ::type
> test_queue;
typename cds::container::msqueue::make_traits <
cds::opt::item_counter< cds::atomicity::item_counter >
, cds::opt::memory_model< cds::opt::v::sequential_consistent>
- , cds::opt::alignment < cds::opt::cache_line_alignment >
+ , cds::opt::padding < cds::opt::cache_line_padding >
> ::type
> test_queue;
test_ic< test_queue >();
typedef cds::container::MSQueue < cds::gc::DHP, int,
typename cds::container::msqueue::make_traits <
cds::opt::memory_model< cds::opt::v::relaxed_ordering>
- , cds::opt::alignment < 16 >
+ , cds::opt::padding < 16 >
> ::type
> test_queue;
typename cds::container::msqueue::make_traits <
cds::opt::item_counter< cds::atomicity::item_counter >
, cds::opt::memory_model< cds::opt::v::relaxed_ordering>
- , cds::opt::alignment < 32 >
+ , cds::opt::padding < 32 >
>::type
> test_queue;
typedef cds::container::MSQueue < cds::gc::DHP, int,
typename cds::container::msqueue::make_traits <
cds::opt::memory_model< cds::opt::v::sequential_consistent>
- ,cds::opt::alignment < cds::opt::no_special_alignment >
+ ,cds::opt::padding < cds::opt::no_special_padding >
> ::type
> test_queue;
typename cds::container::msqueue::make_traits <
cds::opt::item_counter< cds::atomicity::item_counter >
, cds::opt::memory_model< cds::opt::v::sequential_consistent>
- , cds::opt::alignment < cds::opt::cache_line_alignment >
+ , cds::opt::padding < cds::opt::cache_line_padding >
> ::type
> test_queue;
test_ic< test_queue >();
typedef cds::container::MSQueue < cds::gc::HP, int,
typename cds::container::msqueue::make_traits <
cds::opt::memory_model< cds::opt::v::relaxed_ordering>
- , cds::opt::alignment < 16 >
+ , cds::opt::padding < 16 >
> ::type
> test_queue;
typename cds::container::msqueue::make_traits <
cds::opt::item_counter< cds::atomicity::item_counter >
, cds::opt::memory_model< cds::opt::v::relaxed_ordering>
- , cds::opt::alignment < 32 >
+ , cds::opt::padding < 32 >
>::type
> test_queue;
typedef cds::container::MSQueue < cds::gc::HP, int,
typename cds::container::msqueue::make_traits <
cds::opt::memory_model< cds::opt::v::sequential_consistent>
- ,cds::opt::alignment < cds::opt::no_special_alignment >
+ ,cds::opt::padding < cds::opt::no_special_padding >
> ::type
> test_queue;
typename cds::container::msqueue::make_traits <
cds::opt::item_counter< cds::atomicity::item_counter >
, cds::opt::memory_model< cds::opt::v::sequential_consistent>
- , cds::opt::alignment < cds::opt::cache_line_alignment >
+ , cds::opt::padding < cds::opt::cache_line_padding >
> ::type
> test_queue;
test_ic< test_queue >();
-
-
# Boost race [?] in test framework. Do not affect to libcds
race:CppUnitMini::ThreadPool::~ThreadPool
+
+# DHP
+race:cds::gc::details::retired_ptr::free
+
+# uRCU false positive
+race:cds::urcu::gc*::batch_retire*