#define __CDS_CONTAINER_MOIR_QUEUE_H
#include <memory>
-#include <functional> // ref
+#include <cds/container/msqueue.h>
#include <cds/intrusive/moir_queue.h>
-#include <cds/intrusive/details/queue_stat.h>
-#include <cds/container/details/base.h>
-#include <cds/details/trivial_assign.h>
namespace cds { namespace container {
//@cond
namespace details {
- template <typename GC, typename T, typename... Options>
- struct make_moir_queue
+ template <typename GC, typename T, typename Traits>
+ struct make_moir_queue: public cds::container::details::make_msqueue< GC, T, Traits >
{
- typedef GC gc;
- typedef T value_type;
-
- struct default_options {
- typedef cds::backoff::empty back_off;
- typedef CDS_DEFAULT_ALLOCATOR allocator;
- typedef atomicity::empty_item_counter item_counter;
- typedef intrusive::queue_dummy_stat stat;
- typedef opt::v::relaxed_ordering memory_model;
- enum { alignment = opt::cache_line_alignment };
- };
-
- typedef typename opt::make_options<
- typename cds::opt::find_type_traits< default_options, Options... >::type
- ,Options...
- >::type options;
-
- struct node_type: public intrusive::single_link::node< gc >
- {
- value_type m_value;
-
- node_type( const value_type& val )
- : m_value( val )
- {}
-
- template <typename... Args>
- node_type( Args&&... args )
- : m_value( std::forward<Args>(args)...)
- {}
- };
-
- typedef typename options::allocator::template rebind<node_type>::other allocator_type;
- typedef cds::details::Allocator< node_type, allocator_type > cxx_allocator;
-
- struct node_deallocator
- {
- void operator ()( node_type * pNode )
- {
- cxx_allocator().Delete( pNode );
- }
- };
-
- typedef intrusive::MoirQueue<
- gc
- ,node_type
- ,intrusive::opt::hook<
- intrusive::single_link::base_hook< opt::gc<gc> >
- >
- ,opt::back_off< typename options::back_off >
- ,intrusive::opt::disposer< node_deallocator >
- ,opt::item_counter< typename options::item_counter >
- ,opt::stat< typename options::stat >
- ,opt::alignment< options::alignment >
- ,opt::memory_model< typename options::memory_model >
- > type;
+ typedef cds::container::details::make_msqueue< GC, T, Traits > base_class;
+ typedef cds::intrusive::MoirQueue< GC, base_class::node_type, base_class::intrusive_traits > type;
};
}
//@endcond
/// A variation of Michael & Scott's lock-free queue
/** @ingroup cds_nonintrusive_queue
- It is non-intrusive version of intrusive::MoirQueue.
-
- \p T is a type stored in the queue. It should be default-constructible, copy-constructible, assignable type.
+ It is non-intrusive version of \p cds::intrusive::MoirQueue.
- \p Options description see MSQueue
+ Template arguments:
+ - \p GC - garbage collector type: \p gc::HP, \p gc::DHP
+ - \p T is a type stored in the queue.
+ - \p Traits - queue traits, default is \p msqueue::traits. You can use \p msqueue::make_traits
+ metafunction to make your traits or just derive your traits from \p %msqueue::traits:
+ \code
+ struct myTraits: public cds::container::msqueue::traits {
+ typedef cds::intrusive::msqueue::stat<> stat;
+ typedef cds::atomicity::item_counter item_counter;
+ };
+ typedef cds::container::MoirQueue< cds::gc::HP, Foo, myTraits > myQueue;
+
+ // Equivalent make_traits example:
+ typedef cds::container::MoirQueue< cds::gc::HP, Foo,
+ typename cds::container::msqueue::make_traits<
+ cds::opt::stat< cds::container::msqueue::stat<> >,
+ cds::opt::item_counter< cds::atomicity::item_counter >
+ >::type
+ > myQueue;
+ \endcode
*/
- template <typename GC, typename T, typename... Options>
+ template <typename GC, typename T, typename Traits>
class MoirQueue:
#ifdef CDS_DOXYGEN_INVOKED
- intrusive::MoirQueue< GC, intrusive::single_link::node< T >, Options... >
+ intrusive::MoirQueue< GC, intrusive::msqueue::node< T >, Traits >
#else
- details::make_moir_queue< GC, T, Options... >::type
+ details::make_moir_queue< GC, T, Traits >::type
#endif
{
//@cond
- typedef details::make_moir_queue< GC, T, Options... > options;
- typedef typename options::type base_class;
+ typedef details::make_moir_queue< GC, T, Traits > maker;
+ typedef typename maker::type base_class;
//@endcond
public:
/// Rebind template arguments
- template <typename GC2, typename T2, typename... Options2>
+ template <typename GC2, typename T2, typename Traits2>
struct rebind {
- typedef MoirQueue< GC2, T2, Options2...> other ; ///< Rebinding result
+ typedef MoirQueue< GC2, T2, Traits2 > other ; ///< Rebinding result
};
public:
typedef T value_type ; ///< Value type stored in the stack
-
- typedef typename base_class::gc gc ; ///< Garbage collector used
- typedef typename base_class::back_off back_off ; ///< Back-off strategy used
- typedef typename options::allocator_type allocator_type ; ///< Allocator type used for allocate/deallocate the nodes
- typedef typename options::options::item_counter item_counter ; ///< Item counting policy used
- typedef typename options::options::stat stat ; ///< Internal statistics policy used
- typedef typename base_class::memory_model memory_model ; ///< Memory ordering. See cds::opt::memory_model option
+ typedef typename base_class::gc gc; ///< Garbage collector
+ typedef typename base_class::back_off back_off; ///< Back-off strategy
+ typedef typename maker::allocator_type allocator_type; ///< Allocator type used for allocate/deallocate the nodes
+ typedef typename base_class::item_counter item_counter; ///< Item counting policy used
+ typedef typename base_class::stat stat; ///< Internal statistics policy used
+ typedef typename base_class::memory_model memory_model; ///< Memory ordering. See cds::opt::memory_model option
protected:
- typedef typename options::node_type node_type ; ///< queue node type (derived from intrusive::single_link::node)
-
//@cond
- typedef typename options::cxx_allocator cxx_allocator;
- typedef typename options::node_deallocator node_deallocator; // deallocate node
- typedef typename base_class::node_traits node_traits;
+ typedef typename maker::node_type node_type; ///< queue node type (derived from intrusive::msqueue::node)
+
+ typedef typename maker::cxx_allocator cxx_allocator;
+ typedef typename maker::node_deallocator node_deallocator; // deallocate node
+ typedef typename base_class::node_traits node_traits;
//@endcond
protected:
~MoirQueue()
{}
- /// Returns queue's item count (see \ref intrusive::MSQueue::size for explanation)
- size_t size() const
- {
- return base_class::size();
- }
-
- /// Returns refernce to internal statistics
- const stat& statistics() const
- {
- return base_class::statistics();
- }
-
/// Enqueues \p val value into the queue.
/**
The function makes queue node in dynamic memory calling copy constructor for \p val
- and then it calls intrusive::MSQueue::enqueue.
+ and then it calls intrusive::MoirQueue::enqueue.
Returns \p true if success, \p false otherwise.
*/
bool enqueue( value_type const& val )
return false;
}
- /// Enqueues \p data to queue using copy functor
+ /// Enqueues \p data to queue using a functor
/**
- \p Func is a functor called to copy value \p data of type \p Type
- which may be differ from type \p T stored in the queue.
- The functor's interface is:
+ \p Func is a functor called to create node.
+ The functor should initialize creating node
+ and it \p f takes one argument - a reference to a new node of type \ref value_type:
\code
- struct myFunctor {
- void operator()(T& dest, SOURCE const& data)
- {
- // // Code to copy \p data to \p dest
- dest = data;
- }
- };
+ cds:container::MoirQueue< cds::gc::HP, Foo > myQueue;
+ Bar bar;
+ myQueue.enqueue_with( [&bar]( Foo& dest ) { dest = bar; } );
\endcode
- You may use \p boost:ref construction to pass functor \p f by reference.
-
- <b>Requirements</b> The functor \p Func should not throw any exception.
*/
- template <typename Type, typename Func>
- bool enqueue( const Type& data, Func f )
+ template <typename Func>
+ bool enqueue_with( Func f )
{
- scoped_node_ptr p( alloc_node());
- f( node_traits::to_value_ptr( *p )->m_value, data );
+ scoped_node_ptr p( alloc_node() );
+ f( p->m_value );
if ( base_class::enqueue( *p )) {
p.release();
return true;
return false;
}
- /// Dequeues a value using copy functor
- /**
- \p Func is a functor called to copy dequeued value to \p dest of type \p Type
- which may be differ from type \p T stored in the queue.
- The functor's interface is:
- \code
- struct myFunctor {
- void operator()(Type& dest, T const& data)
- {
- // // Code to copy \p data to \p dest
- dest = data;
- }
- };
- \endcode
- You may use \p boost:ref construction to pass functor \p f by reference.
-
- <b>Requirements</b> The functor \p Func should not throw any exception.
- */
- template <typename Type, typename Func>
- bool dequeue( Type& dest, Func f )
+ /// Enqueues data of type \ref value_type constructed with <tt>std::forward<Args>(args)...</tt>
+ template <typename... Args>
+ bool emplace( Args&&... args )
{
- typename base_class::dequeue_result res;
- if ( base_class::do_dequeue( res )) {
- f( dest, node_traits::to_value_ptr( *res.pNext )->m_value );
-
- base_class::dispose_result( res );
-
+ scoped_node_ptr p( alloc_node_move( std::forward<Args>( args )... ) );
+ if ( base_class::enqueue( *p ) ) {
+ p.release();
return true;
}
return false;
}
+ /// Synonym for \p enqueue() function
+ bool push( value_type const& val )
+ {
+ return enqueue( val );
+ }
+
+ /// Synonym for \p enqueue_with() function
+ template <typename Func>
+ bool push_with( Func f )
+ {
+ return enqueue_with( f );
+ }
+
/// Dequeues a value from the queue
/**
If queue is not empty, the function returns \p true, \p dest contains copy of
*/
bool dequeue( value_type& dest )
{
- typedef cds::details::trivial_assign<value_type, value_type> functor;
- return dequeue( dest, functor() );
+ return dequeue_with( [&dest]( value_type& src ) { dest = src; } );
}
- /// Synonym for \ref enqueue function
- bool push( const value_type& val )
- {
- return enqueue( val );
- }
-
- /// Synonym for template version of \ref enqueue function
- template <typename Type, typename Func>
- bool push( const Type& data, Func f )
- {
- return enqueue( data, f );
- }
-
- /// Enqueues data of type \ref value_type constructed with <tt>std::forward<Args>(args)...</tt>
- template <typename... Args>
- bool emplace( Args&&... args )
+ /// Dequeues a value using a functor
+ /**
+ \p Func is a functor called to copy dequeued value.
+ The functor takes one argument - a reference to removed node:
+ \code
+ cds:container::MoirQueue< cds::gc::HP, Foo > myQueue;
+ Bar bar;
+ myQueue.dequeue_with( [&bar]( Foo& src ) { bar = std::move( src );});
+ \endcode
+ The functor is called only if the queue is not empty.
+ */
+ template <typename Func>
+ bool dequeue_with( Func f )
{
- scoped_node_ptr p( alloc_node_move( std::forward<Args>(args)... ));
- if ( base_class::enqueue( *p )) {
- p.release();
+ typename base_class::dequeue_result res;
+ if ( base_class::do_dequeue( res )) {
+ f( node_traits::to_value_ptr( *res.pNext )->m_value );
+ base_class::dispose_result( res );
return true;
}
return false;
}
- /// Synonym for \ref dequeue function
+ /// Synonym for \p dequeue() function
bool pop( value_type& dest )
{
return dequeue( dest );
}
- /// Synonym for template version of \ref dequeue function
- template <typename Type, typename Func>
- bool pop( Type& dest, Func f )
+ /// Synonym for \p dequeue_with() function
+ template <typename Func>
+ bool pop_with( Func f )
{
- return dequeue( dest, f );
- }
-
- /// Checks if the queue is empty
- bool empty() const
- {
- return base_class::empty();
+ return dequeue_with( f );
}
/// Clear the queue
{
base_class::clear();
}
+
+ /// Checks if the queue is empty
+ bool empty() const
+ {
+ return base_class::empty();
+ }
+
+ /// Returns queue's item count (see \ref intrusive::MSQueue::size for explanation)
+ size_t size() const
+ {
+ return base_class::size();
+ }
+
+ /// Returns refernce to internal statistics
+ const stat& statistics() const
+ {
+ return base_class::statistics();
+ }
+
};
}} // namespace cds::container
#define __CDS_CONTAINER_MSQUEUE_H
#include <memory>
-#include <functional> // ref
#include <cds/intrusive/msqueue.h>
#include <cds/container/details/base.h>
typedef T value_type;
typedef Traits traits;
- struct node_type: public intrusive::msqueue::node< gc >
+ struct node_type : public intrusive::msqueue::node< gc >
{
value_type m_value;
template <typename... Args>
node_type( Args&&... args )
- : m_value( std::forward<Args>(args)...)
+ : m_value( std::forward<Args>( args )... )
{}
};
> myQueue;
\endcode
*/
- template <typename GC, typename T, typename Traits>
+ template <typename GC, typename T, typename Traits = msqueue::traits>
class MSQueue:
#ifdef CDS_DOXYGEN_INVOKED
intrusive::MSQueue< GC, cds::intrusive::msqueue::node< T >, Traits >
typedef typename base_class::memory_model memory_model; ///< Memory ordering. See cds::opt::memory_model option
protected:
- typedef typename maker::node_type node_type ; ///< queue node type (derived from \p intrusive::msqueue::node)
-
//@cond
+ typedef typename maker::node_type node_type; ///< queue node type (derived from \p intrusive::msqueue::node)
+
typedef typename maker::cxx_allocator cxx_allocator;
typedef typename maker::node_deallocator node_deallocator; // deallocate node
- typedef typename base_class::node_traits node_traits;
+ typedef typename base_class::node_traits node_traits;
//@endcond
protected:
~MSQueue()
{}
- /// Returns queue's item count (see \ref intrusive::MSQueue::size for explanation)
- size_t size() const
- {
- return base_class::size();
- }
-
- /// Returns reference to internal statistics
- const stat& statistics() const
- {
- return base_class::statistics();
- }
-
/// Enqueues \p val value into the queue.
/**
The function makes queue node in dynamic memory calling copy constructor for \p val
return false;
}
- /// Synonym for \ref enqueue function
+ /// Synonym for \p enqueue() function
bool push( value_type const& val )
{
return enqueue( val );
return enqueue_with( f );
}
+ /// Dequeues a value from the queue
+ /**
+ If queue is not empty, the function returns \p true, \p dest contains copy of
+ dequeued value. The assignment operator for type \ref value_type is invoked.
+ If queue is empty, the function returns \p false, \p dest is unchanged.
+ */
+ bool dequeue( value_type& dest )
+ {
+ return dequeue_with( [&dest]( value_type& src ) { dest = src; } );
+ }
+
/// Dequeues a value using a functor
/**
\p Func is a functor called to copy dequeued value.
Bar bar;
myQueue.dequeue_with( [&bar]( Foo& src ) { bar = std::move( src );});
\endcode
- The functor is called only is the queue is not empty.
+ The functor is called only if the queue is not empty.
*/
template <typename Func>
bool dequeue_with( Func f )
return false;
}
- /// Dequeues a value from the queue
- /**
- If queue is not empty, the function returns \p true, \p dest contains copy of
- dequeued value. The assignment operator for type \ref value_type is invoked.
- If queue is empty, the function returns \p false, \p dest is unchanged.
- */
- bool dequeue( value_type& dest )
- {
- typedef cds::details::trivial_assign<value_type, value_type> functor;
- return dequeue( dest, functor() );
- }
-
- /// Synonym for \ref dequeue function
+ /// Synonym for \p dequeue() function
bool pop( value_type& dest )
{
return dequeue( dest );
return dequeue_with( f );
}
+ /// Clear the queue
+ /**
+ The function repeatedly calls \ref dequeue until it returns \p nullptr.
+ */
+ void clear()
+ {
+ base_class::clear();
+ }
+
/// Checks if the queue is empty
bool empty() const
{
return base_class::empty();
}
- /// Clear the queue
- /**
- The function repeatedly calls \ref dequeue until it returns \p nullptr.
- */
- void clear()
+ /// Returns queue's item count (see \ref intrusive::MSQueue::size for explanation)
+ size_t size() const
{
- base_class::clear();
+ return base_class::size();
+ }
+
+ /// Returns reference to internal statistics
+ const stat& statistics() const
+ {
+ return base_class::statistics();
}
};
dispose_node( pHead );
}
- /// Returns queue's item count
- /**
- The value returned depends on \p msqueue::traits::item_counter. For \p atomicity::empty_item_counter,
- this function always returns 0.
-
- @note Even if you use real item counter and it returns 0, this fact is not mean that the queue
- is empty. To check queue emptyness use \p empty() method.
- */
- size_t size() const
- {
- return m_ItemCounter.value();
- }
-
- /// Returns reference to internal statistics
- stat const& statistics() const
- {
- return m_Stat;
- }
-
/// Enqueues \p val value into the queue.
/** @anchor cds_intrusive_MSQueue_enqueue
The function always returns \p true.
{
while ( dequeue() );
}
+
+ /// Returns queue's item count
+ /**
+ The value returned depends on \p msqueue::traits::item_counter. For \p atomicity::empty_item_counter,
+ this function always returns 0.
+
+ @note Even if you use real item counter and it returns 0, this fact is not mean that the queue
+ is empty. To check queue emptyness use \p empty() method.
+ */
+ size_t size() const
+ {
+ return m_ItemCounter.value();
+ }
+
+ /// Returns reference to internal statistics
+ stat const& statistics() const
+ {
+ return m_Stat;
+ }
+
};
}} // namespace cds::intrusive
- Removed: MichaelDeque, reason: the implementation is heavy-weighted, inefficient,
and, seems, unstable.
- Added: cds::container::TreiberStack::pop_with( Func )
+ - Added: member functions enqueue_with(Func), dequeue_with(Func) to cds::container::MSQueue,
+ cds::container::MoirQueue.
1.6.0 23.09.2014
General release
<ClCompile Include="..\..\..\tests\test-hdr\queue\hdr_intrusive_segmented_queue_ptb.cpp" />\r
<ClCompile Include="..\..\..\tests\test-hdr\queue\hdr_intrusive_tsigas_cycle_queue.cpp" />\r
<ClCompile Include="..\..\..\tests\test-hdr\queue\hdr_intrusive_vyukovmpmc_cycle_queue.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\queue\hdr_moirqueue_hrc.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\queue\hdr_moirqueue_hzp.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\queue\hdr_moirqueue_ptb.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\queue\hdr_msqueue_hrc.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\queue\hdr_msqueue_hzp.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\queue\hdr_msqueue_ptb.cpp" />\r
+ <ClCompile Include="..\..\..\tests\test-hdr\queue\hdr_moirqueue_dhp.cpp" />\r
+ <ClCompile Include="..\..\..\tests\test-hdr\queue\hdr_moirqueue_hp.cpp" />\r
+ <ClCompile Include="..\..\..\tests\test-hdr\queue\hdr_msqueue_dhp.cpp" />\r
+ <ClCompile Include="..\..\..\tests\test-hdr\queue\hdr_msqueue_hp.cpp" />\r
<ClCompile Include="..\..\..\tests\test-hdr\queue\hdr_optimistic_hzp.cpp" />\r
<ClCompile Include="..\..\..\tests\test-hdr\queue\hdr_optimistic_ptb.cpp" />\r
+ <ClCompile Include="..\..\..\tests\test-hdr\queue\hdr_queue_register.cpp" />\r
<ClCompile Include="..\..\..\tests\test-hdr\queue\hdr_rwqueue.cpp" />\r
<ClCompile Include="..\..\..\tests\test-hdr\queue\hdr_segmented_queue_hp.cpp" />\r
<ClCompile Include="..\..\..\tests\test-hdr\queue\hdr_segmented_queue_ptb.cpp" />\r
<ClCompile Include="..\..\..\tests\test-hdr\queue\hdr_vyukov_mpmc_cyclic.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\queue\queue_test_header.cpp" />\r
</ItemGroup>\r
<ItemGroup>\r
<ClInclude Include="..\..\..\tests\test-hdr\queue\hdr_intrusive_basketqueue_node.h" />\r
<ClInclude Include="..\..\..\tests\test-hdr\queue\hdr_intrusive_msqueue.h" />\r
<ClInclude Include="..\..\..\tests\test-hdr\queue\hdr_intrusive_segmented_queue.h" />\r
<ClInclude Include="..\..\..\tests\test-hdr\queue\hdr_intrusive_singlelink_node.h" />\r
+ <ClInclude Include="..\..\..\tests\test-hdr\queue\hdr_queue.h" />\r
+ <ClInclude Include="..\..\..\tests\test-hdr\queue\hdr_queue_new.h" />\r
<ClInclude Include="..\..\..\tests\test-hdr\queue\hdr_segmented_queue.h" />\r
- <ClInclude Include="..\..\..\tests\test-hdr\queue\queue_test_header.h" />\r
</ItemGroup>\r
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
<ImportGroup Label="ExtensionTargets">\r
<ClCompile Include="..\..\..\tests\test-hdr\queue\hdr_intrusive_vyukovmpmc_cycle_queue.cpp">\r
<Filter>intrusive</Filter>\r
</ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\queue\hdr_moirqueue_hrc.cpp">\r
- <Filter>container</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\queue\hdr_moirqueue_hzp.cpp">\r
- <Filter>container</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\queue\hdr_moirqueue_ptb.cpp">\r
- <Filter>container</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\queue\hdr_msqueue_hrc.cpp">\r
- <Filter>container</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\queue\hdr_msqueue_hzp.cpp">\r
- <Filter>container</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\queue\hdr_msqueue_ptb.cpp">\r
- <Filter>container</Filter>\r
- </ClCompile>\r
<ClCompile Include="..\..\..\tests\test-hdr\queue\hdr_optimistic_hzp.cpp">\r
<Filter>container</Filter>\r
</ClCompile>\r
<ClCompile Include="..\..\..\tests\test-hdr\queue\hdr_vyukov_mpmc_cyclic.cpp">\r
<Filter>container</Filter>\r
</ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\queue\queue_test_header.cpp">\r
- <Filter>container</Filter>\r
- </ClCompile>\r
<ClCompile Include="..\..\..\tests\test-hdr\queue\hdr_intrusive_moirqueue_dhp.cpp">\r
<Filter>intrusive</Filter>\r
</ClCompile>\r
<ClCompile Include="..\..\..\tests\test-hdr\queue\hdr_intrusive_msqueue_dhp.cpp">\r
<Filter>intrusive</Filter>\r
</ClCompile>\r
+ <ClCompile Include="..\..\..\tests\test-hdr\queue\hdr_moirqueue_dhp.cpp">\r
+ <Filter>container</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="..\..\..\tests\test-hdr\queue\hdr_moirqueue_hp.cpp">\r
+ <Filter>container</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="..\..\..\tests\test-hdr\queue\hdr_msqueue_dhp.cpp">\r
+ <Filter>container</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="..\..\..\tests\test-hdr\queue\hdr_msqueue_hp.cpp">\r
+ <Filter>container</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="..\..\..\tests\test-hdr\queue\hdr_queue_register.cpp" />\r
</ItemGroup>\r
<ItemGroup>\r
<ClInclude Include="..\..\..\tests\test-hdr\queue\hdr_intrusive_basketqueue_node.h">\r
<ClInclude Include="..\..\..\tests\test-hdr\queue\hdr_segmented_queue.h">\r
<Filter>container</Filter>\r
</ClInclude>\r
- <ClInclude Include="..\..\..\tests\test-hdr\queue\queue_test_header.h">\r
+ <ClInclude Include="..\..\..\tests\test-hdr\queue\hdr_queue.h">\r
+ <Filter>container</Filter>\r
+ </ClInclude>\r
+ <ClInclude Include="..\..\..\tests\test-hdr\queue\hdr_queue_new.h">\r
<Filter>container</Filter>\r
</ClInclude>\r
</ItemGroup>\r
tests/test-hdr/priority_queue/hdr_priority_queue_reg.cpp
CDS_TESTHDR_QUEUE := \
+ tests/test-hdr/queue/hdr_queue_register.cpp \
tests/test-hdr/queue/hdr_intrusive_basketqueue_hrc.cpp \
tests/test-hdr/queue/hdr_intrusive_fcqueue.cpp \
tests/test-hdr/queue/hdr_intrusive_segmented_queue_hp.cpp \
tests/test-hdr/queue/hdr_basketqueue_hzp.cpp \
tests/test-hdr/queue/hdr_basketqueue_ptb.cpp \
tests/test-hdr/queue/hdr_fcqueue.cpp \
- tests/test-hdr/queue/hdr_moirqueue_hzp.cpp \
- tests/test-hdr/queue/hdr_moirqueue_ptb.cpp \
- tests/test-hdr/queue/hdr_msqueue_hzp.cpp \
- tests/test-hdr/queue/hdr_msqueue_ptb.cpp \
+ tests/test-hdr/queue/hdr_moirqueue_hp.cpp \
+ tests/test-hdr/queue/hdr_moirqueue_dhp.cpp \
+ tests/test-hdr/queue/hdr_msqueue_hp.cpp \
+ tests/test-hdr/queue/hdr_msqueue_dhp.cpp \
tests/test-hdr/queue/hdr_optimistic_hzp.cpp \
tests/test-hdr/queue/hdr_optimistic_ptb.cpp \
tests/test-hdr/queue/hdr_rwqueue.cpp \
tests/test-hdr/queue/hdr_segmented_queue_hp.cpp \
tests/test-hdr/queue/hdr_segmented_queue_ptb.cpp \
- tests/test-hdr/queue/hdr_vyukov_mpmc_cyclic.cpp \
- tests/test-hdr/queue/queue_test_header.cpp
+ tests/test-hdr/queue/hdr_vyukov_mpmc_cyclic.cpp
CDS_TESTHDR_SET := \
tests/test-hdr/set/hdr_intrusive_michael_set_hrc.cpp \
#include <cds/container/basket_queue.h>
#include <cds/gc/hrc.h>
-#include "queue/queue_test_header.h"
+#include "queue/hdr_queue.h"
namespace queue {
#include <cds/container/basket_queue.h>
#include <cds/gc/hp.h>
-#include "queue/queue_test_header.h"
+#include "queue/hdr_queue.h"
namespace queue {
#include <cds/container/basket_queue.h>
#include <cds/gc/ptb.h>
-#include "queue/queue_test_header.h"
+#include "queue/hdr_queue.h"
namespace queue {
//$$CDS-header$$
#include <cds/container/fcqueue.h>
-#include "queue/queue_test_header.h"
+#include "queue/hdr_queue.h"
#include <list>
TEST(MSQueue_HP_member_cachealign)
}
-CPPUNIT_TEST_SUITE_REGISTRATION(queue::IntrusiveQueueHeaderTest);
}
} // namespace queue
-
-CPPUNIT_TEST_SUITE_REGISTRATION(queue::HdrIntrusiveSegmentedQueue);
--- /dev/null
+//$$CDS-header$$
+
+#include <cds/gc/dhp.h>
+#include <cds/container/moir_queue.h>
+#include "queue/hdr_queue_new.h"
+
+namespace queue {
+
+ void HdrTestQueue::MoirQueue_DHP()
+ {
+ typedef cds::container::MoirQueue< cds::gc::DHP, int > test_queue;
+ test_no_ic< test_queue >();
+ }
+
+ void HdrTestQueue::MoirQueue_DHP_Counted()
+ {
+ typedef cds::container::MoirQueue < cds::gc::DHP, int,
+ typename cds::container::msqueue::make_traits <
+ cds::opt::item_counter < cds::atomicity::item_counter >
+ > ::type
+ > test_queue;
+
+ test_ic< test_queue >();
+ }
+
+ void HdrTestQueue::MoirQueue_DHP_relax()
+ {
+ typedef cds::container::MoirQueue < cds::gc::DHP, int,
+ typename cds::container::msqueue::make_traits <
+ cds::opt::memory_model < cds::opt::v::relaxed_ordering >
+ > ::type
+ > test_queue;
+
+ test_no_ic< test_queue >();
+ }
+
+ void HdrTestQueue::MoirQueue_DHP_Counted_relax()
+ {
+ typedef cds::container::MoirQueue < cds::gc::DHP, int,
+ typename cds::container::msqueue::make_traits <
+ cds::opt::item_counter< cds::atomicity::item_counter >
+ , cds::opt::memory_model < cds::opt::v::relaxed_ordering >
+ > ::type
+ > test_queue;
+
+ test_ic< test_queue >();
+ }
+
+ void HdrTestQueue::MoirQueue_DHP_seqcst()
+ {
+ typedef cds::container::MoirQueue < cds::gc::DHP, int,
+ typename cds::container::msqueue::make_traits <
+ cds::opt::memory_model < cds::opt::v::sequential_consistent >
+ > ::type
+ > test_queue;
+
+ test_no_ic< test_queue >();
+ }
+
+ void HdrTestQueue::MoirQueue_DHP_Counted_seqcst()
+ {
+ typedef cds::container::MoirQueue < cds::gc::DHP, int,
+ typename cds::container::msqueue::make_traits <
+ cds::opt::item_counter< cds::atomicity::item_counter >
+ , cds::opt::memory_model < cds::opt::v::sequential_consistent >
+ > ::type
+ > test_queue;
+
+ test_ic< test_queue >();
+ }
+
+ void HdrTestQueue::MoirQueue_DHP_relax_align()
+ {
+ 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 >
+ > ::type
+ > test_queue;
+
+ test_no_ic< test_queue >();
+ }
+
+ void HdrTestQueue::MoirQueue_DHP_Counted_relax_align()
+ {
+ typedef cds::container::MoirQueue < cds::gc::DHP, int,
+ 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 >
+ >::type
+ > test_queue;
+
+ test_ic< test_queue >();
+ }
+
+ void HdrTestQueue::MoirQueue_DHP_seqcst_align()
+ {
+ 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 >
+ > ::type
+ > test_queue;
+
+ test_no_ic< test_queue >();
+ }
+
+ void HdrTestQueue::MoirQueue_DHP_Counted_seqcst_align()
+ {
+ typedef cds::container::MoirQueue < cds::gc::DHP, int,
+ 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 >
+ > ::type
+ > test_queue;
+ test_ic< test_queue >();
+ }
+} // namespace queue
--- /dev/null
+//$$CDS-header$$
+
+#include <cds/gc/hp.h>
+#include <cds/container/moir_queue.h>
+
+#include "queue/hdr_queue_new.h"
+
+namespace queue {
+
+ void HdrTestQueue::MoirQueue_HP()
+ {
+ typedef cds::container::MoirQueue< cds::gc::HP, int > test_queue;
+ test_no_ic< test_queue >();
+ }
+
+ void HdrTestQueue::MoirQueue_HP_Counted()
+ {
+ typedef cds::container::MoirQueue < cds::gc::HP, int,
+ typename cds::container::msqueue::make_traits <
+ cds::opt::item_counter < cds::atomicity::item_counter >
+ > ::type
+ > test_queue;
+
+ test_ic< test_queue >();
+ }
+
+ void HdrTestQueue::MoirQueue_HP_relax()
+ {
+ typedef cds::container::MoirQueue < cds::gc::HP, int,
+ typename cds::container::msqueue::make_traits <
+ cds::opt::memory_model < cds::opt::v::relaxed_ordering >
+ > ::type
+ > test_queue;
+
+ test_no_ic< test_queue >();
+ }
+
+ void HdrTestQueue::MoirQueue_HP_Counted_relax()
+ {
+ typedef cds::container::MoirQueue < cds::gc::HP, int,
+ typename cds::container::msqueue::make_traits <
+ cds::opt::item_counter< cds::atomicity::item_counter >
+ , cds::opt::memory_model < cds::opt::v::relaxed_ordering >
+ > ::type
+ > test_queue;
+
+ test_ic< test_queue >();
+ }
+
+ void HdrTestQueue::MoirQueue_HP_seqcst()
+ {
+ typedef cds::container::MoirQueue < cds::gc::HP, int,
+ typename cds::container::msqueue::make_traits <
+ cds::opt::memory_model < cds::opt::v::sequential_consistent >
+ > ::type
+ > test_queue;
+
+ test_no_ic< test_queue >();
+ }
+
+ void HdrTestQueue::MoirQueue_HP_Counted_seqcst()
+ {
+ typedef cds::container::MoirQueue < cds::gc::HP, int,
+ typename cds::container::msqueue::make_traits <
+ cds::opt::item_counter< cds::atomicity::item_counter >
+ , cds::opt::memory_model < cds::opt::v::sequential_consistent >
+ > ::type
+ > test_queue;
+
+ test_ic< test_queue >();
+ }
+
+ void HdrTestQueue::MoirQueue_HP_relax_align()
+ {
+ 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 >
+ > ::type
+ > test_queue;
+
+ test_no_ic< test_queue >();
+ }
+
+ void HdrTestQueue::MoirQueue_HP_Counted_relax_align()
+ {
+ typedef cds::container::MoirQueue < cds::gc::HP, int,
+ 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 >
+ >::type
+ > test_queue;
+
+ test_ic< test_queue >();
+ }
+
+ void HdrTestQueue::MoirQueue_HP_seqcst_align()
+ {
+ 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 >
+ > ::type
+ > test_queue;
+
+ test_no_ic< test_queue >();
+ }
+
+ void HdrTestQueue::MoirQueue_HP_Counted_seqcst_align()
+ {
+ typedef cds::container::MoirQueue < cds::gc::HP, int,
+ 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 >
+ > ::type
+ > test_queue;
+ test_ic< test_queue >();
+ }
+} // namespace queue
+++ /dev/null
-//$$CDS-header$$
-
-#include <cds/container/moir_queue.h>
-#include <cds/gc/hrc.h>
-
-#include "queue/queue_test_header.h"
-
-namespace queue {
-
- void Queue_TestHeader::MoirQueue_HRC()
- {
- testNoItemCounter<
- cds::container::MoirQueue< cds::gc::HRC, int
- >
- >();
- }
-
- void Queue_TestHeader::MoirQueue_HRC_Counted()
- {
- testWithItemCounter<
- cds::container::MoirQueue< cds::gc::HRC, int
- ,cds::opt::item_counter< cds::atomicity::item_counter >
- >
- >();
- }
-
- void Queue_TestHeader::MoirQueue_HRC_relax()
- {
- testNoItemCounter<
- cds::container::MoirQueue< cds::gc::HRC, int
- ,cds::opt::memory_model< cds::opt::v::relaxed_ordering>
- >
- >();
- }
-
- void Queue_TestHeader::MoirQueue_HRC_Counted_relax()
- {
- testWithItemCounter<
- cds::container::MoirQueue< cds::gc::HRC, int
- ,cds::opt::item_counter< cds::atomicity::item_counter >
- ,cds::opt::memory_model< cds::opt::v::relaxed_ordering>
- >
- >();
- }
-
- void Queue_TestHeader::MoirQueue_HRC_seqcst()
- {
- testNoItemCounter<
- cds::container::MoirQueue< cds::gc::HRC, int
- ,cds::opt::memory_model< cds::opt::v::sequential_consistent>
- >
- >();
- }
-
- void Queue_TestHeader::MoirQueue_HRC_Counted_seqcst()
- {
- testWithItemCounter<
- cds::container::MoirQueue< cds::gc::HRC, int
- ,cds::opt::item_counter< cds::atomicity::item_counter >
- ,cds::opt::memory_model< cds::opt::v::sequential_consistent>
- >
- >();
- }
-
- void Queue_TestHeader::MoirQueue_HRC_relax_align()
- {
- testNoItemCounter<
- cds::container::MoirQueue< cds::gc::HRC, int
- ,cds::opt::memory_model< cds::opt::v::relaxed_ordering>
- ,cds::opt::alignment< 16 >
- >
- >();
- }
-
- void Queue_TestHeader::MoirQueue_HRC_Counted_relax_align()
- {
- testWithItemCounter<
- cds::container::MoirQueue< cds::gc::HRC, int
- ,cds::opt::item_counter< cds::atomicity::item_counter >
- ,cds::opt::memory_model< cds::opt::v::relaxed_ordering>
- ,cds::opt::alignment< 32 >
- >
- >();
- }
-
- void Queue_TestHeader::MoirQueue_HRC_seqcst_align()
- {
- testNoItemCounter<
- cds::container::MoirQueue< cds::gc::HRC, int
- ,cds::opt::memory_model< cds::opt::v::sequential_consistent>
- ,cds::opt::alignment< cds::opt::no_special_alignment >
- >
- >();
- }
-
- void Queue_TestHeader::MoirQueue_HRC_Counted_seqcst_align()
- {
- testWithItemCounter<
- cds::container::MoirQueue< cds::gc::HRC, int
- ,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 >
- >
- >();
- }
-
-} // namespace queue
+++ /dev/null
-//$$CDS-header$$
-
-#include <cds/container/moir_queue.h>
-#include <cds/gc/hp.h>
-
-#include "queue/queue_test_header.h"
-
-namespace queue {
-
- void Queue_TestHeader::MoirQueue_HP()
- {
- testNoItemCounter<
- cds::container::MoirQueue< cds::gc::HP, int
- >
- >();
- }
-
- void Queue_TestHeader::MoirQueue_HP_Counted()
- {
- testWithItemCounter<
- cds::container::MoirQueue< cds::gc::HP, int
- ,cds::opt::item_counter< cds::atomicity::item_counter >
- >
- >();
- }
-
- void Queue_TestHeader::MoirQueue_HP_relax()
- {
- testNoItemCounter<
- cds::container::MoirQueue< cds::gc::HP, int
- ,cds::opt::memory_model< cds::opt::v::relaxed_ordering>
- >
- >();
- }
-
- void Queue_TestHeader::MoirQueue_HP_Counted_relax()
- {
- testWithItemCounter<
- cds::container::MoirQueue< cds::gc::HP, int
- ,cds::opt::item_counter< cds::atomicity::item_counter >
- ,cds::opt::memory_model< cds::opt::v::relaxed_ordering>
- >
- >();
- }
-
- void Queue_TestHeader::MoirQueue_HP_seqcst()
- {
- testNoItemCounter<
- cds::container::MoirQueue< cds::gc::HP, int
- ,cds::opt::memory_model< cds::opt::v::sequential_consistent>
- >
- >();
- }
-
- void Queue_TestHeader::MoirQueue_HP_Counted_seqcst()
- {
- testWithItemCounter<
- cds::container::MoirQueue< cds::gc::HP, int
- ,cds::opt::item_counter< cds::atomicity::item_counter >
- ,cds::opt::memory_model< cds::opt::v::sequential_consistent>
- >
- >();
- }
-
- void Queue_TestHeader::MoirQueue_HP_relax_align()
- {
- testNoItemCounter<
- cds::container::MoirQueue< cds::gc::HP, int
- ,cds::opt::memory_model< cds::opt::v::relaxed_ordering>
- ,cds::opt::alignment< 16 >
- >
- >();
- }
-
- void Queue_TestHeader::MoirQueue_HP_Counted_relax_align()
- {
- testWithItemCounter<
- cds::container::MoirQueue< cds::gc::HP, int
- ,cds::opt::item_counter< cds::atomicity::item_counter >
- ,cds::opt::memory_model< cds::opt::v::relaxed_ordering>
- ,cds::opt::alignment< 32 >
- >
- >();
- }
-
- void Queue_TestHeader::MoirQueue_HP_seqcst_align()
- {
- testNoItemCounter<
- cds::container::MoirQueue< cds::gc::HP, int
- ,cds::opt::memory_model< cds::opt::v::sequential_consistent>
- ,cds::opt::alignment< cds::opt::no_special_alignment >
- >
- >();
- }
-
- void Queue_TestHeader::MoirQueue_HP_Counted_seqcst_align()
- {
- testWithItemCounter<
- cds::container::MoirQueue< cds::gc::HP, int
- ,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 >
- >
- >();
- }
-
-} // namespace queue
+++ /dev/null
-//$$CDS-header$$
-
-#include <cds/container/moir_queue.h>
-#include <cds/gc/ptb.h>
-
-#include "queue/queue_test_header.h"
-
-namespace queue {
-
- void Queue_TestHeader::MoirQueue_PTB()
- {
- testNoItemCounter<
- cds::container::MoirQueue< cds::gc::PTB, int
- >
- >();
- }
-
- void Queue_TestHeader::MoirQueue_PTB_Counted()
- {
- testWithItemCounter<
- cds::container::MoirQueue< cds::gc::PTB, int
- ,cds::opt::item_counter< cds::atomicity::item_counter >
- >
- >();
- }
-
- void Queue_TestHeader::MoirQueue_PTB_relax()
- {
- testNoItemCounter<
- cds::container::MoirQueue< cds::gc::PTB, int
- ,cds::opt::memory_model< cds::opt::v::relaxed_ordering>
- >
- >();
- }
-
- void Queue_TestHeader::MoirQueue_PTB_Counted_relax()
- {
- testWithItemCounter<
- cds::container::MoirQueue< cds::gc::PTB, int
- ,cds::opt::item_counter< cds::atomicity::item_counter >
- ,cds::opt::memory_model< cds::opt::v::relaxed_ordering>
- >
- >();
- }
-
- void Queue_TestHeader::MoirQueue_PTB_seqcst()
- {
- testNoItemCounter<
- cds::container::MoirQueue< cds::gc::PTB, int
- ,cds::opt::memory_model< cds::opt::v::sequential_consistent>
- >
- >();
- }
-
- void Queue_TestHeader::MoirQueue_PTB_Counted_seqcst()
- {
- testWithItemCounter<
- cds::container::MoirQueue< cds::gc::PTB, int
- ,cds::opt::item_counter< cds::atomicity::item_counter >
- ,cds::opt::memory_model< cds::opt::v::sequential_consistent>
- >
- >();
- }
-
- void Queue_TestHeader::MoirQueue_PTB_relax_align()
- {
- testNoItemCounter<
- cds::container::MoirQueue< cds::gc::PTB, int
- ,cds::opt::memory_model< cds::opt::v::relaxed_ordering>
- ,cds::opt::alignment< 16 >
- >
- >();
- }
-
- void Queue_TestHeader::MoirQueue_PTB_Counted_relax_align()
- {
- testWithItemCounter<
- cds::container::MoirQueue< cds::gc::PTB, int
- ,cds::opt::item_counter< cds::atomicity::item_counter >
- ,cds::opt::memory_model< cds::opt::v::relaxed_ordering>
- ,cds::opt::alignment< 32 >
- >
- >();
- }
-
- void Queue_TestHeader::MoirQueue_PTB_seqcst_align()
- {
- testNoItemCounter<
- cds::container::MoirQueue< cds::gc::PTB, int
- ,cds::opt::memory_model< cds::opt::v::sequential_consistent>
- ,cds::opt::alignment< cds::opt::no_special_alignment >
- >
- >();
- }
-
- void Queue_TestHeader::MoirQueue_PTB_Counted_seqcst_align()
- {
- testWithItemCounter<
- cds::container::MoirQueue< cds::gc::PTB, int
- ,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 >
- >
- >();
- }
-
-} // namespace queue
--- /dev/null
+//$$CDS-header$$
+
+#include <cds/gc/dhp.h>
+#include <cds/container/msqueue.h>
+
+#include "queue/hdr_queue_new.h"
+
+namespace queue {
+
+ void HdrTestQueue::MSQueue_DHP()
+ {
+ typedef cds::container::MSQueue< cds::gc::DHP, int > test_queue;
+ test_no_ic< test_queue >();
+ }
+
+ void HdrTestQueue::MSQueue_DHP_Counted()
+ {
+ typedef cds::container::MSQueue < cds::gc::DHP, int,
+ typename cds::container::msqueue::make_traits <
+ cds::opt::item_counter < cds::atomicity::item_counter >
+ > ::type
+ > test_queue;
+
+ test_ic< test_queue >();
+ }
+
+ void HdrTestQueue::MSQueue_DHP_relax()
+ {
+ typedef cds::container::MSQueue < cds::gc::DHP, int,
+ typename cds::container::msqueue::make_traits <
+ cds::opt::memory_model < cds::opt::v::relaxed_ordering >
+ > ::type
+ > test_queue;
+
+ test_no_ic< test_queue >();
+ }
+
+ void HdrTestQueue::MSQueue_DHP_Counted_relax()
+ {
+ typedef cds::container::MSQueue < cds::gc::DHP, int,
+ typename cds::container::msqueue::make_traits <
+ cds::opt::item_counter< cds::atomicity::item_counter >
+ , cds::opt::memory_model < cds::opt::v::relaxed_ordering >
+ > ::type
+ > test_queue;
+
+ test_ic< test_queue >();
+ }
+
+ void HdrTestQueue::MSQueue_DHP_seqcst()
+ {
+ typedef cds::container::MSQueue < cds::gc::DHP, int,
+ typename cds::container::msqueue::make_traits <
+ cds::opt::memory_model < cds::opt::v::sequential_consistent >
+ > ::type
+ > test_queue;
+
+ test_no_ic< test_queue >();
+ }
+
+ void HdrTestQueue::MSQueue_DHP_Counted_seqcst()
+ {
+ typedef cds::container::MSQueue < cds::gc::DHP, int,
+ typename cds::container::msqueue::make_traits <
+ cds::opt::item_counter< cds::atomicity::item_counter >
+ , cds::opt::memory_model < cds::opt::v::sequential_consistent >
+ > ::type
+ > test_queue;
+
+ test_ic< test_queue >();
+ }
+
+ void HdrTestQueue::MSQueue_DHP_relax_align()
+ {
+ 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 >
+ > ::type
+ > test_queue;
+
+ test_no_ic< test_queue >();
+ }
+
+ void HdrTestQueue::MSQueue_DHP_Counted_relax_align()
+ {
+ typedef cds::container::MSQueue < cds::gc::DHP, int,
+ 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 >
+ >::type
+ > test_queue;
+
+ test_ic< test_queue >();
+ }
+
+ void HdrTestQueue::MSQueue_DHP_seqcst_align()
+ {
+ 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 >
+ > ::type
+ > test_queue;
+
+ test_no_ic< test_queue >();
+ }
+
+ void HdrTestQueue::MSQueue_DHP_Counted_seqcst_align()
+ {
+ typedef cds::container::MSQueue < cds::gc::DHP, int,
+ 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 >
+ > ::type
+ > test_queue;
+ test_ic< test_queue >();
+ }
+} // namespace queue
--- /dev/null
+//$$CDS-header$$
+
+#include <cds/gc/hp.h>
+#include <cds/container/msqueue.h>
+
+#include "queue/hdr_queue_new.h"
+
+namespace queue {
+
+ void HdrTestQueue::MSQueue_HP()
+ {
+ typedef cds::container::MSQueue< cds::gc::HP, int > test_queue;
+ test_no_ic< test_queue >();
+ }
+
+ void HdrTestQueue::MSQueue_HP_Counted()
+ {
+ typedef cds::container::MSQueue < cds::gc::HP, int,
+ typename cds::container::msqueue::make_traits <
+ cds::opt::item_counter < cds::atomicity::item_counter >
+ > ::type
+ > test_queue;
+
+ test_ic< test_queue >();
+ }
+
+ void HdrTestQueue::MSQueue_HP_relax()
+ {
+ typedef cds::container::MSQueue < cds::gc::HP, int,
+ typename cds::container::msqueue::make_traits <
+ cds::opt::memory_model < cds::opt::v::relaxed_ordering >
+ > ::type
+ > test_queue;
+
+ test_no_ic< test_queue >();
+ }
+
+ void HdrTestQueue::MSQueue_HP_Counted_relax()
+ {
+ typedef cds::container::MSQueue < cds::gc::HP, int,
+ typename cds::container::msqueue::make_traits <
+ cds::opt::item_counter< cds::atomicity::item_counter >
+ , cds::opt::memory_model < cds::opt::v::relaxed_ordering >
+ > ::type
+ > test_queue;
+
+ test_ic< test_queue >();
+ }
+
+ void HdrTestQueue::MSQueue_HP_seqcst()
+ {
+ typedef cds::container::MSQueue < cds::gc::HP, int,
+ typename cds::container::msqueue::make_traits <
+ cds::opt::memory_model < cds::opt::v::sequential_consistent >
+ > ::type
+ > test_queue;
+
+ test_no_ic< test_queue >();
+ }
+
+ void HdrTestQueue::MSQueue_HP_Counted_seqcst()
+ {
+ typedef cds::container::MSQueue < cds::gc::HP, int,
+ typename cds::container::msqueue::make_traits <
+ cds::opt::item_counter< cds::atomicity::item_counter >
+ , cds::opt::memory_model < cds::opt::v::sequential_consistent >
+ > ::type
+ > test_queue;
+
+ test_ic< test_queue >();
+ }
+
+ void HdrTestQueue::MSQueue_HP_relax_align()
+ {
+ 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 >
+ > ::type
+ > test_queue;
+
+ test_no_ic< test_queue >();
+ }
+
+ void HdrTestQueue::MSQueue_HP_Counted_relax_align()
+ {
+ typedef cds::container::MSQueue < cds::gc::HP, int,
+ 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 >
+ >::type
+ > test_queue;
+
+ test_ic< test_queue >();
+ }
+
+ void HdrTestQueue::MSQueue_HP_seqcst_align()
+ {
+ 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 >
+ > ::type
+ > test_queue;
+
+ test_no_ic< test_queue >();
+ }
+
+ void HdrTestQueue::MSQueue_HP_Counted_seqcst_align()
+ {
+ typedef cds::container::MSQueue < cds::gc::HP, int,
+ 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 >
+ > ::type
+ > test_queue;
+ test_ic< test_queue >();
+ }
+} // namespace queue
+++ /dev/null
-//$$CDS-header$$
-
-#include <cds/container/msqueue.h>
-#include <cds/gc/hrc.h>
-
-#include "queue/queue_test_header.h"
-
-namespace queue {
-
- void Queue_TestHeader::MSQueue_HRC()
- {
- testNoItemCounter<
- cds::container::MSQueue< cds::gc::HRC, int
- >
- >();
- }
-
- void Queue_TestHeader::MSQueue_HRC_Counted()
- {
- testWithItemCounter<
- cds::container::MSQueue< cds::gc::HRC, int
- ,cds::opt::item_counter< cds::atomicity::item_counter >
- >
- >();
- }
-
- void Queue_TestHeader::MSQueue_HRC_relax()
- {
- testNoItemCounter<
- cds::container::MSQueue< cds::gc::HRC, int
- ,cds::opt::memory_model< cds::opt::v::relaxed_ordering>
- >
- >();
- }
-
- void Queue_TestHeader::MSQueue_HRC_Counted_relax()
- {
- testWithItemCounter<
- cds::container::MSQueue< cds::gc::HRC, int
- ,cds::opt::item_counter< cds::atomicity::item_counter >
- ,cds::opt::memory_model< cds::opt::v::relaxed_ordering>
- >
- >();
- }
-
- void Queue_TestHeader::MSQueue_HRC_seqcst()
- {
- testNoItemCounter<
- cds::container::MSQueue< cds::gc::HRC, int
- ,cds::opt::memory_model< cds::opt::v::sequential_consistent>
- >
- >();
- }
-
- void Queue_TestHeader::MSQueue_HRC_Counted_seqcst()
- {
- testWithItemCounter<
- cds::container::MSQueue< cds::gc::HRC, int
- ,cds::opt::item_counter< cds::atomicity::item_counter >
- ,cds::opt::memory_model< cds::opt::v::sequential_consistent>
- >
- >();
- }
-
- void Queue_TestHeader::MSQueue_HRC_relax_align()
- {
- testNoItemCounter<
- cds::container::MSQueue< cds::gc::HRC, int
- ,cds::opt::memory_model< cds::opt::v::relaxed_ordering>
- ,cds::opt::alignment< 16 >
- >
- >();
- }
-
- void Queue_TestHeader::MSQueue_HRC_Counted_relax_align()
- {
- testWithItemCounter<
- cds::container::MSQueue< cds::gc::HRC, int
- ,cds::opt::item_counter< cds::atomicity::item_counter >
- ,cds::opt::memory_model< cds::opt::v::relaxed_ordering>
- ,cds::opt::alignment< 32 >
- >
- >();
- }
-
- void Queue_TestHeader::MSQueue_HRC_seqcst_align()
- {
- testNoItemCounter<
- cds::container::MSQueue< cds::gc::HRC, int
- ,cds::opt::memory_model< cds::opt::v::sequential_consistent>
- ,cds::opt::alignment< cds::opt::no_special_alignment >
- >
- >();
- }
-
- void Queue_TestHeader::MSQueue_HRC_Counted_seqcst_align()
- {
- testWithItemCounter<
- cds::container::MSQueue< cds::gc::HRC, int
- ,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 >
- >
- >();
- }
-
-} // namespace queue
+++ /dev/null
-//$$CDS-header$$
-
-#include <cds/container/msqueue.h>
-#include <cds/gc/hp.h>
-
-#include "queue/queue_test_header.h"
-
-namespace queue {
-
- void Queue_TestHeader::MSQueue_HP()
- {
- testNoItemCounter<
- cds::container::MSQueue< cds::gc::HP, int
- >
- >();
- }
-
- void Queue_TestHeader::MSQueue_HP_Counted()
- {
- testWithItemCounter<
- cds::container::MSQueue< cds::gc::HP, int
- ,cds::opt::item_counter< cds::atomicity::item_counter >
- >
- >();
- }
-
- void Queue_TestHeader::MSQueue_HP_relax()
- {
- testNoItemCounter<
- cds::container::MSQueue< cds::gc::HP, int
- ,cds::opt::memory_model< cds::opt::v::relaxed_ordering>
- >
- >();
- }
-
- void Queue_TestHeader::MSQueue_HP_Counted_relax()
- {
- testWithItemCounter<
- cds::container::MSQueue< cds::gc::HP, int
- ,cds::opt::item_counter< cds::atomicity::item_counter >
- ,cds::opt::memory_model< cds::opt::v::relaxed_ordering>
- >
- >();
- }
-
- void Queue_TestHeader::MSQueue_HP_seqcst()
- {
- testNoItemCounter<
- cds::container::MSQueue< cds::gc::HP, int
- ,cds::opt::memory_model< cds::opt::v::sequential_consistent>
- >
- >();
- }
-
- void Queue_TestHeader::MSQueue_HP_Counted_seqcst()
- {
- testWithItemCounter<
- cds::container::MSQueue< cds::gc::HP, int
- ,cds::opt::item_counter< cds::atomicity::item_counter >
- ,cds::opt::memory_model< cds::opt::v::sequential_consistent>
- >
- >();
- }
-
- void Queue_TestHeader::MSQueue_HP_relax_align()
- {
- testNoItemCounter<
- cds::container::MSQueue< cds::gc::HP, int
- ,cds::opt::memory_model< cds::opt::v::relaxed_ordering>
- ,cds::opt::alignment< 16 >
- >
- >();
- }
-
- void Queue_TestHeader::MSQueue_HP_Counted_relax_align()
- {
- testWithItemCounter<
- cds::container::MSQueue< cds::gc::HP, int
- ,cds::opt::item_counter< cds::atomicity::item_counter >
- ,cds::opt::memory_model< cds::opt::v::relaxed_ordering>
- ,cds::opt::alignment< 32 >
- >
- >();
- }
-
- void Queue_TestHeader::MSQueue_HP_seqcst_align()
- {
- testNoItemCounter<
- cds::container::MSQueue< cds::gc::HP, int
- ,cds::opt::memory_model< cds::opt::v::sequential_consistent>
- ,cds::opt::alignment< cds::opt::no_special_alignment >
- >
- >();
- }
-
- void Queue_TestHeader::MSQueue_HP_Counted_seqcst_align()
- {
- testWithItemCounter<
- cds::container::MSQueue< cds::gc::HP, int
- ,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 >
- >
- >();
- }
-
-} // namespace queue
+++ /dev/null
-//$$CDS-header$$
-
-#include <cds/container/msqueue.h>
-#include <cds/gc/ptb.h>
-
-#include "queue/queue_test_header.h"
-
-namespace queue {
-
- void Queue_TestHeader::MSQueue_PTB()
- {
- testNoItemCounter<
- cds::container::MSQueue< cds::gc::PTB, int
- >
- >();
- }
-
- void Queue_TestHeader::MSQueue_PTB_Counted()
- {
- testWithItemCounter<
- cds::container::MSQueue< cds::gc::PTB, int
- ,cds::opt::item_counter< cds::atomicity::item_counter >
- >
- >();
- }
-
- void Queue_TestHeader::MSQueue_PTB_relax()
- {
- testNoItemCounter<
- cds::container::MSQueue< cds::gc::PTB, int
- ,cds::opt::memory_model< cds::opt::v::relaxed_ordering>
- >
- >();
- }
-
- void Queue_TestHeader::MSQueue_PTB_Counted_relax()
- {
- testWithItemCounter<
- cds::container::MSQueue< cds::gc::PTB, int
- ,cds::opt::item_counter< cds::atomicity::item_counter >
- ,cds::opt::memory_model< cds::opt::v::relaxed_ordering>
- >
- >();
- }
-
- void Queue_TestHeader::MSQueue_PTB_seqcst()
- {
- testNoItemCounter<
- cds::container::MSQueue< cds::gc::PTB, int
- ,cds::opt::memory_model< cds::opt::v::sequential_consistent>
- >
- >();
- }
-
- void Queue_TestHeader::MSQueue_PTB_Counted_seqcst()
- {
- testWithItemCounter<
- cds::container::MSQueue< cds::gc::PTB, int
- ,cds::opt::item_counter< cds::atomicity::item_counter >
- ,cds::opt::memory_model< cds::opt::v::sequential_consistent>
- >
- >();
- }
-
- void Queue_TestHeader::MSQueue_PTB_relax_align()
- {
- testNoItemCounter<
- cds::container::MSQueue< cds::gc::PTB, int
- ,cds::opt::memory_model< cds::opt::v::relaxed_ordering>
- ,cds::opt::alignment< 16 >
- >
- >();
- }
-
- void Queue_TestHeader::MSQueue_PTB_Counted_relax_align()
- {
- testWithItemCounter<
- cds::container::MSQueue< cds::gc::PTB, int
- ,cds::opt::item_counter< cds::atomicity::item_counter >
- ,cds::opt::memory_model< cds::opt::v::relaxed_ordering>
- ,cds::opt::alignment< 32 >
- >
- >();
- }
-
- void Queue_TestHeader::MSQueue_PTB_seqcst_align()
- {
- testNoItemCounter<
- cds::container::MSQueue< cds::gc::PTB, int
- ,cds::opt::memory_model< cds::opt::v::sequential_consistent>
- ,cds::opt::alignment< cds::opt::no_special_alignment >
- >
- >();
- }
-
- void Queue_TestHeader::MSQueue_PTB_Counted_seqcst_align()
- {
- testWithItemCounter<
- cds::container::MSQueue< cds::gc::PTB, int
- ,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 >
- >
- >();
- }
-
-} // namespace queue
#include <cds/container/optimistic_queue.h>
#include <cds/gc/hp.h>
-#include "queue/queue_test_header.h"
+#include "queue/hdr_queue.h"
namespace queue {
#include <cds/container/optimistic_queue.h>
#include <cds/gc/ptb.h>
-#include "queue/queue_test_header.h"
+#include "queue/hdr_queue.h"
namespace queue {
--- /dev/null
+//$$CDS-header$$
+
+#ifndef __UNIT_QUEUE_SIMPLE_H
+#define __UNIT_QUEUE_SIMPLE_H
+
+#include "cppunit/cppunit_proxy.h"
+#include <cds/details/defs.h>
+
+namespace queue {
+
+ //
+ // Test queue operation in single thread mode
+ //
+ class Queue_TestHeader: public CppUnitMini::TestCase
+ {
+ protected:
+ template <class Queue>
+ void testNoItemCounter()
+ {
+ Queue q;
+ test_with( q );
+ test_emplace( q );
+ }
+
+ template <class Queue>
+ void test_with( Queue& q )
+ {
+ int it;
+ int nPrev;
+
+ for ( size_t i = 0; i < 3; ++i ) {
+ CPPUNIT_ASSERT( q.empty() );
+#ifndef _DEBUG
+ CPPUNIT_ASSERT( q.size() == 0 );
+#endif
+ CPPUNIT_ASSERT( q.enqueue( 1 ) );
+ CPPUNIT_ASSERT( !q.empty() );
+ CPPUNIT_ASSERT( q.push( 10 ) );
+ CPPUNIT_ASSERT( !q.empty() );
+#ifndef _DEBUG
+ CPPUNIT_ASSERT( q.size() == 0 ) ; // no queue's item counter!
+#endif
+
+ it = -1;
+ CPPUNIT_ASSERT( q.pop( it ) );
+ CPPUNIT_ASSERT( it == 1 );
+ CPPUNIT_ASSERT( !q.empty() );
+ CPPUNIT_ASSERT( q.dequeue( it ) );
+ CPPUNIT_ASSERT( it == 10 );
+#ifndef _DEBUG
+ CPPUNIT_ASSERT( q.size() == 0 );
+#endif
+ CPPUNIT_ASSERT( q.empty() );
+ it += 2009;
+ nPrev = it;
+ CPPUNIT_ASSERT( !q.dequeue( it ) );
+ CPPUNIT_ASSERT( it == nPrev ) ; // it must not be changed!
+ }
+ }
+
+ template <class Queue>
+ void test_emplace( Queue& q )
+ {
+ int it;
+ for ( size_t i = 0; i < 3; ++i ) {
+ CPPUNIT_ASSERT( q.emplace( static_cast<int>( i * 42 )) );
+ CPPUNIT_ASSERT( !q.empty() );
+ it = -1;
+ CPPUNIT_ASSERT( q.pop( it ));
+ CPPUNIT_ASSERT( it == static_cast<int>( i * 42 ));
+ CPPUNIT_ASSERT( q.empty() );
+ }
+ }
+
+ template <class Queue>
+ void testWithItemCounter()
+ {
+ Queue q;
+ test_ic_with( q );
+ test_emplace_ic( q );
+ }
+
+ template <class Queue>
+ void testFCQueue()
+ {
+ Queue q;
+ test_ic_with( q );
+ }
+
+ template <class Queue>
+ void test_ic_with( Queue& q )
+ {
+ int it;
+ int nPrev;
+
+ for ( size_t i = 0; i < 3; ++i ) {
+ CPPUNIT_ASSERT( q.empty() );
+ CPPUNIT_ASSERT( q.size() == 0 );
+ CPPUNIT_ASSERT( q.enqueue( 1 ) );
+ CPPUNIT_ASSERT( q.size() == 1 );
+ CPPUNIT_ASSERT( !q.empty() );
+ CPPUNIT_ASSERT( q.push( 10 ) );
+ CPPUNIT_ASSERT( !q.empty() );
+ CPPUNIT_ASSERT( q.size() == 2 );
+
+ it = -1;
+ CPPUNIT_ASSERT( q.pop( it ) );
+ CPPUNIT_ASSERT( it == 1 );
+ CPPUNIT_ASSERT( !q.empty() );
+ CPPUNIT_ASSERT( q.size() == 1 );
+ CPPUNIT_ASSERT( q.dequeue( it ) );
+ CPPUNIT_ASSERT( it == 10 );
+ CPPUNIT_ASSERT( q.size() == 0 );
+ CPPUNIT_ASSERT( q.empty() );
+ CPPUNIT_ASSERT( q.size() == 0 );
+ it += 2009;
+ nPrev = it;
+ CPPUNIT_ASSERT( !q.dequeue( it ) );
+ CPPUNIT_ASSERT( it == nPrev ) ; // it must not be changed!
+
+ CPPUNIT_ASSERT( q.empty() );
+ CPPUNIT_ASSERT( q.size() == 0 );
+ }
+ }
+
+ template <class Queue>
+ void test_emplace_ic( Queue& q )
+ {
+ int it = 0;
+ for ( size_t i = 0; i < 3; ++i ) {
+ CPPUNIT_ASSERT( q.emplace( (int) i * 10 ) );
+ CPPUNIT_ASSERT( !q.empty() );
+ CPPUNIT_ASSERT( q.size() == 1 );
+ CPPUNIT_ASSERT( q.pop( it ));
+ CPPUNIT_ASSERT( it == (int) i * 10 );
+ CPPUNIT_ASSERT( q.empty() );
+ CPPUNIT_ASSERT( q.size() == 0 );
+ }
+ }
+
+ public:
+ void MSQueue_HP();
+ void MSQueue_HP_relax();
+ void MSQueue_HP_seqcst();
+ void MSQueue_HP_relax_align();
+ void MSQueue_HP_seqcst_align();
+ void MSQueue_HP_Counted();
+ void MSQueue_HP_Counted_relax();
+ void MSQueue_HP_Counted_seqcst();
+ void MSQueue_HP_Counted_relax_align();
+ void MSQueue_HP_Counted_seqcst_align();
+
+ void MSQueue_DHP();
+ void MSQueue_DHP_relax();
+ void MSQueue_DHP_seqcst();
+ void MSQueue_DHP_relax_align();
+ void MSQueue_DHP_seqcst_align();
+ void MSQueue_DHP_Counted();
+ void MSQueue_DHP_Counted_relax();
+ void MSQueue_DHP_Counted_seqcst();
+ void MSQueue_DHP_Counted_relax_align();
+ void MSQueue_DHP_Counted_seqcst_align();
+
+ void MoirQueue_HP();
+ void MoirQueue_HP_relax();
+ void MoirQueue_HP_seqcst();
+ void MoirQueue_HP_relax_align();
+ void MoirQueue_HP_seqcst_align();
+ void MoirQueue_HP_Counted();
+ void MoirQueue_HP_Counted_relax();
+ void MoirQueue_HP_Counted_seqcst();
+ void MoirQueue_HP_Counted_relax_align();
+ void MoirQueue_HP_Counted_seqcst_align();
+
+ void MoirQueue_DHP();
+ void MoirQueue_DHP_relax();
+ void MoirQueue_DHP_seqcst();
+ void MoirQueue_DHP_relax_align();
+ void MoirQueue_DHP_seqcst_align();
+ void MoirQueue_DHP_Counted();
+ void MoirQueue_DHP_Counted_relax();
+ void MoirQueue_DHP_Counted_seqcst();
+ void MoirQueue_DHP_Counted_relax_align();
+ void MoirQueue_DHP_Counted_seqcst_align();
+
+ void OptimisticQueue_HP();
+ void OptimisticQueue_HP_relax();
+ void OptimisticQueue_HP_seqcst();
+ void OptimisticQueue_HP_relax_align();
+ void OptimisticQueue_HP_seqcst_align();
+ void OptimisticQueue_HP_Counted();
+ void OptimisticQueue_HP_Counted_relax();
+ void OptimisticQueue_HP_Counted_seqcst();
+ void OptimisticQueue_HP_Counted_relax_align();
+ void OptimisticQueue_HP_Counted_seqcst_align();
+
+ void OptimisticQueue_PTB();
+ void OptimisticQueue_PTB_relax();
+ void OptimisticQueue_PTB_seqcst();
+ void OptimisticQueue_PTB_relax_align();
+ void OptimisticQueue_PTB_seqcst_align();
+ void OptimisticQueue_PTB_Counted();
+ void OptimisticQueue_PTB_Counted_relax();
+ void OptimisticQueue_PTB_Counted_seqcst();
+ void OptimisticQueue_PTB_Counted_relax_align();
+ void OptimisticQueue_PTB_Counted_seqcst_align();
+
+ void BasketQueue_HP();
+ void BasketQueue_HP_relax();
+ void BasketQueue_HP_seqcst();
+ void BasketQueue_HP_relax_align();
+ void BasketQueue_HP_seqcst_align();
+ void BasketQueue_HP_Counted();
+ void BasketQueue_HP_Counted_relax();
+ void BasketQueue_HP_Counted_seqcst();
+ void BasketQueue_HP_Counted_relax_align();
+ void BasketQueue_HP_Counted_seqcst_align();
+
+ void BasketQueue_HRC();
+ void BasketQueue_HRC_relax();
+ void BasketQueue_HRC_seqcst();
+ void BasketQueue_HRC_relax_align();
+ void BasketQueue_HRC_seqcst_align();
+ void BasketQueue_HRC_Counted();
+ void BasketQueue_HRC_Counted_relax();
+ void BasketQueue_HRC_Counted_seqcst();
+ void BasketQueue_HRC_Counted_relax_align();
+ void BasketQueue_HRC_Counted_seqcst_align();
+
+ void BasketQueue_PTB();
+ void BasketQueue_PTB_relax();
+ void BasketQueue_PTB_seqcst();
+ void BasketQueue_PTB_relax_align();
+ void BasketQueue_PTB_seqcst_align();
+ void BasketQueue_PTB_Counted();
+ void BasketQueue_PTB_Counted_relax();
+ void BasketQueue_PTB_Counted_seqcst();
+ void BasketQueue_PTB_Counted_relax_align();
+ void BasketQueue_PTB_Counted_seqcst_align();
+
+ void FCQueue_deque();
+ void FCQueue_deque_elimination();
+ void FCQueue_deque_mutex();
+ void FCQueue_deque_stat();
+ void FCQueue_list();
+ void FCQueue_list_elimination();
+ void FCQueue_list_mutex();
+ void FCQueue_list_stat();
+
+ void Vyukov_MPMCCyclicQueue();
+ void Vyukov_MPMCCyclicQueue_Counted();
+
+ void RWQueue_();
+ void RWQueue_Counted();
+
+ CPPUNIT_TEST_SUITE(Queue_TestHeader)
+ CPPUNIT_TEST(MSQueue_HP);
+ CPPUNIT_TEST(MSQueue_HP_relax);
+ CPPUNIT_TEST(MSQueue_HP_seqcst);
+ CPPUNIT_TEST(MSQueue_HP_relax_align);
+ CPPUNIT_TEST(MSQueue_HP_seqcst_align);
+ CPPUNIT_TEST(MSQueue_HP_Counted);
+ CPPUNIT_TEST(MSQueue_HP_Counted_relax);
+ CPPUNIT_TEST(MSQueue_HP_Counted_seqcst);
+ CPPUNIT_TEST(MSQueue_HP_Counted_relax_align);
+ CPPUNIT_TEST(MSQueue_HP_Counted_seqcst_align);
+
+ CPPUNIT_TEST(MSQueue_DHP);
+ CPPUNIT_TEST(MSQueue_DHP_relax);
+ CPPUNIT_TEST(MSQueue_DHP_seqcst);
+ CPPUNIT_TEST(MSQueue_DHP_relax_align);
+ CPPUNIT_TEST(MSQueue_DHP_seqcst_align);
+ CPPUNIT_TEST(MSQueue_DHP_Counted);
+ CPPUNIT_TEST(MSQueue_DHP_Counted_relax);
+ CPPUNIT_TEST(MSQueue_DHP_Counted_seqcst);
+ CPPUNIT_TEST(MSQueue_DHP_Counted_relax_align);
+ CPPUNIT_TEST(MSQueue_DHP_Counted_seqcst_align);
+
+ CPPUNIT_TEST(MoirQueue_HP);
+ CPPUNIT_TEST(MoirQueue_HP_relax);
+ CPPUNIT_TEST(MoirQueue_HP_seqcst);
+ CPPUNIT_TEST(MoirQueue_HP_relax_align);
+ CPPUNIT_TEST(MoirQueue_HP_seqcst_align);
+ CPPUNIT_TEST(MoirQueue_HP_Counted);
+ CPPUNIT_TEST(MoirQueue_HP_Counted_relax);
+ CPPUNIT_TEST(MoirQueue_HP_Counted_seqcst);
+ CPPUNIT_TEST(MoirQueue_HP_Counted_relax_align);
+ CPPUNIT_TEST(MoirQueue_HP_Counted_seqcst_align);
+
+ CPPUNIT_TEST(MoirQueue_DHP);
+ CPPUNIT_TEST(MoirQueue_DHP_relax);
+ CPPUNIT_TEST(MoirQueue_DHP_seqcst);
+ CPPUNIT_TEST(MoirQueue_DHP_relax_align);
+ CPPUNIT_TEST(MoirQueue_DHP_seqcst_align);
+ CPPUNIT_TEST(MoirQueue_DHP_Counted);
+ CPPUNIT_TEST(MoirQueue_DHP_Counted_relax);
+ CPPUNIT_TEST(MoirQueue_DHP_Counted_seqcst);
+ CPPUNIT_TEST(MoirQueue_DHP_Counted_relax_align);
+ CPPUNIT_TEST(MoirQueue_DHP_Counted_seqcst_align);
+
+ CPPUNIT_TEST(OptimisticQueue_HP);
+ CPPUNIT_TEST(OptimisticQueue_HP_relax);
+ CPPUNIT_TEST(OptimisticQueue_HP_seqcst);
+ CPPUNIT_TEST(OptimisticQueue_HP_relax_align);
+ CPPUNIT_TEST(OptimisticQueue_HP_seqcst_align);
+ CPPUNIT_TEST(OptimisticQueue_HP_Counted);
+ CPPUNIT_TEST(OptimisticQueue_HP_Counted_relax);
+ CPPUNIT_TEST(OptimisticQueue_HP_Counted_seqcst);
+ CPPUNIT_TEST(OptimisticQueue_HP_Counted_relax_align);
+ CPPUNIT_TEST(OptimisticQueue_HP_Counted_seqcst_align);
+
+ CPPUNIT_TEST(OptimisticQueue_PTB);
+ CPPUNIT_TEST(OptimisticQueue_PTB_relax);
+ CPPUNIT_TEST(OptimisticQueue_PTB_seqcst);
+ CPPUNIT_TEST(OptimisticQueue_PTB_relax_align);
+ CPPUNIT_TEST(OptimisticQueue_PTB_seqcst_align);
+ CPPUNIT_TEST(OptimisticQueue_PTB_Counted);
+ CPPUNIT_TEST(OptimisticQueue_PTB_Counted_relax);
+ CPPUNIT_TEST(OptimisticQueue_PTB_Counted_seqcst);
+ CPPUNIT_TEST(OptimisticQueue_PTB_Counted_relax_align);
+ CPPUNIT_TEST(OptimisticQueue_PTB_Counted_seqcst_align);
+
+ CPPUNIT_TEST(BasketQueue_HP);
+ CPPUNIT_TEST(BasketQueue_HP_relax);
+ CPPUNIT_TEST(BasketQueue_HP_seqcst);
+ CPPUNIT_TEST(BasketQueue_HP_relax_align);
+ CPPUNIT_TEST(BasketQueue_HP_seqcst_align);
+ CPPUNIT_TEST(BasketQueue_HP_Counted);
+ CPPUNIT_TEST(BasketQueue_HP_Counted_relax);
+ CPPUNIT_TEST(BasketQueue_HP_Counted_seqcst);
+ CPPUNIT_TEST(BasketQueue_HP_Counted_relax_align);
+ CPPUNIT_TEST(BasketQueue_HP_Counted_seqcst_align);
+
+ CPPUNIT_TEST(BasketQueue_HRC);
+ CPPUNIT_TEST(BasketQueue_HRC_relax);
+ CPPUNIT_TEST(BasketQueue_HRC_seqcst);
+ CPPUNIT_TEST(BasketQueue_HRC_relax_align);
+ CPPUNIT_TEST(BasketQueue_HRC_seqcst_align);
+ CPPUNIT_TEST(BasketQueue_HRC_Counted);
+ CPPUNIT_TEST(BasketQueue_HRC_Counted_relax);
+ CPPUNIT_TEST(BasketQueue_HRC_Counted_seqcst);
+ CPPUNIT_TEST(BasketQueue_HRC_Counted_relax_align);
+ CPPUNIT_TEST(BasketQueue_HRC_Counted_seqcst_align);
+
+ CPPUNIT_TEST(BasketQueue_PTB);
+ CPPUNIT_TEST(BasketQueue_PTB_relax);
+ CPPUNIT_TEST(BasketQueue_PTB_seqcst);
+ CPPUNIT_TEST(BasketQueue_PTB_relax_align);
+ CPPUNIT_TEST(BasketQueue_PTB_seqcst_align);
+ CPPUNIT_TEST(BasketQueue_PTB_Counted);
+ CPPUNIT_TEST(BasketQueue_PTB_Counted_relax);
+ CPPUNIT_TEST(BasketQueue_PTB_Counted_seqcst);
+ CPPUNIT_TEST(BasketQueue_PTB_Counted_relax_align);
+ CPPUNIT_TEST(BasketQueue_PTB_Counted_seqcst_align);
+
+ CPPUNIT_TEST(FCQueue_deque)
+ CPPUNIT_TEST(FCQueue_deque_elimination)
+ CPPUNIT_TEST(FCQueue_deque_mutex)
+ CPPUNIT_TEST(FCQueue_deque_stat)
+ CPPUNIT_TEST(FCQueue_list)
+ CPPUNIT_TEST(FCQueue_list_elimination)
+ CPPUNIT_TEST(FCQueue_list_mutex)
+ CPPUNIT_TEST(FCQueue_list_stat)
+
+ CPPUNIT_TEST(RWQueue_);
+ CPPUNIT_TEST(RWQueue_Counted);
+
+ CPPUNIT_TEST(Vyukov_MPMCCyclicQueue);
+ CPPUNIT_TEST(Vyukov_MPMCCyclicQueue_Counted);
+ CPPUNIT_TEST_SUITE_END();
+
+ };
+} // namespace queue
+
+#endif // #ifndef __UNIT_QUEUE_SIMPLE_H
--- /dev/null
+//$$CDS-header$$
+
+#ifndef __CDSUNIT_QUEUE_HDR_H
+#define __CDSUNIT_QUEUE_HDR_H
+
+#include "cppunit/cppunit_proxy.h"
+#include <cds/details/defs.h>
+
+namespace queue {
+
+ //
+ // Test queue operation in single thread mode
+ //
+ class HdrTestQueue: public CppUnitMini::TestCase
+ {
+ protected:
+ template <class Queue>
+ void test_no_ic()
+ {
+ Queue q;
+ test_with( q );
+ test_emplace( q );
+ }
+
+ template <class Queue>
+ void test_with( Queue& q )
+ {
+ int it;
+ int nPrev;
+
+ // push/pop
+ for ( size_t i = 0; i < 3; ++i ) {
+ CPPUNIT_ASSERT( q.empty() );
+#ifndef _DEBUG
+ CPPUNIT_ASSERT( q.size() == 0 );
+#endif
+ CPPUNIT_ASSERT( q.enqueue( 1 ) );
+ CPPUNIT_ASSERT( !q.empty() );
+ CPPUNIT_ASSERT( q.push( 10 ) );
+ CPPUNIT_ASSERT( !q.empty() );
+#ifndef _DEBUG
+ CPPUNIT_ASSERT( q.size() == 0 ) ; // no queue's item counter!
+#endif
+
+ it = -1;
+ CPPUNIT_ASSERT( q.pop( it ) );
+ CPPUNIT_ASSERT( it == 1 );
+ CPPUNIT_ASSERT( !q.empty() );
+ CPPUNIT_ASSERT( q.dequeue( it ) );
+ CPPUNIT_ASSERT( it == 10 );
+#ifndef _DEBUG
+ CPPUNIT_ASSERT( q.size() == 0 );
+#endif
+ CPPUNIT_ASSERT( q.empty() );
+ it += 2009;
+ nPrev = it;
+ CPPUNIT_ASSERT( !q.dequeue( it ) );
+ CPPUNIT_ASSERT( it == nPrev ) ; // it must not be changed!
+ }
+
+ // push_with/pop_with
+ for ( size_t i = 0; i < 3; ++i ) {
+ CPPUNIT_ASSERT( q.empty() );
+#ifndef _DEBUG
+ CPPUNIT_ASSERT( q.size() == 0 );
+#endif
+ CPPUNIT_ASSERT( q.enqueue_with( []( int& dest ) { dest = 1; } ));
+ CPPUNIT_ASSERT( !q.empty() );
+ CPPUNIT_ASSERT( q.push_with( []( int& dest ) { dest = 10; } ));
+ CPPUNIT_ASSERT( !q.empty() );
+#ifndef _DEBUG
+ CPPUNIT_ASSERT( q.size() == 0 ); // no queue's item counter!
+#endif
+
+ it = -1;
+ CPPUNIT_ASSERT( q.pop_with( [&it]( int src ) { it = src; } ));
+ CPPUNIT_ASSERT( it == 1 );
+ CPPUNIT_ASSERT( !q.empty() );
+ CPPUNIT_ASSERT( q.dequeue_with( [&it]( int src ) { it = src; } ));
+ CPPUNIT_ASSERT( it == 10 );
+#ifndef _DEBUG
+ CPPUNIT_ASSERT( q.size() == 0 );
+#endif
+ CPPUNIT_ASSERT( q.empty() );
+ it += 2009;
+ nPrev = it;
+ CPPUNIT_ASSERT( !q.dequeue_with( [&it]( int src ) { it = src; } ));
+ CPPUNIT_ASSERT( it == nPrev ); // it must not be changed!
+ }
+ }
+
+ template <class Queue>
+ void test_emplace( Queue& q )
+ {
+ int it;
+ for ( size_t i = 0; i < 3; ++i ) {
+ CPPUNIT_ASSERT( q.emplace( static_cast<int>( i * 42 )) );
+ CPPUNIT_ASSERT( !q.empty() );
+ it = -1;
+ CPPUNIT_ASSERT( q.pop( it ));
+ CPPUNIT_ASSERT( it == static_cast<int>( i * 42 ));
+ CPPUNIT_ASSERT( q.empty() );
+ }
+ }
+
+ template <class Queue>
+ void test_ic()
+ {
+ Queue q;
+ test_ic_with( q );
+ test_emplace_ic( q );
+ }
+
+ template <class Queue>
+ void testFCQueue()
+ {
+ Queue q;
+ test_ic_with( q );
+ }
+
+ template <class Queue>
+ void test_ic_with( Queue& q )
+ {
+ int it;
+ int nPrev;
+
+ // push/pop
+ for ( size_t i = 0; i < 3; ++i ) {
+ CPPUNIT_ASSERT( q.empty() );
+ CPPUNIT_ASSERT( q.size() == 0 );
+ CPPUNIT_ASSERT( q.enqueue( 1 ) );
+ CPPUNIT_ASSERT( q.size() == 1 );
+ CPPUNIT_ASSERT( !q.empty() );
+ CPPUNIT_ASSERT( q.push( 10 ) );
+ CPPUNIT_ASSERT( !q.empty() );
+ CPPUNIT_ASSERT( q.size() == 2 );
+
+ it = -1;
+ CPPUNIT_ASSERT( q.pop( it ) );
+ CPPUNIT_ASSERT( it == 1 );
+ CPPUNIT_ASSERT( !q.empty() );
+ CPPUNIT_ASSERT( q.size() == 1 );
+ CPPUNIT_ASSERT( q.dequeue( it ) );
+ CPPUNIT_ASSERT( it == 10 );
+ CPPUNIT_ASSERT( q.size() == 0 );
+ CPPUNIT_ASSERT( q.empty() );
+ CPPUNIT_ASSERT( q.size() == 0 );
+ it += 2009;
+ nPrev = it;
+ CPPUNIT_ASSERT( !q.dequeue( it ) );
+ CPPUNIT_ASSERT( it == nPrev ) ; // it must not be changed!
+
+ CPPUNIT_ASSERT( q.empty() );
+ CPPUNIT_ASSERT( q.size() == 0 );
+ }
+
+ // push_with/pop_with
+ for ( size_t i = 0; i < 3; ++i ) {
+ CPPUNIT_ASSERT( q.empty() );
+ CPPUNIT_ASSERT( q.size() == 0 );
+ CPPUNIT_ASSERT( q.enqueue_with( []( int& dest ) { dest = 1; } ) );
+ CPPUNIT_ASSERT( !q.empty() );
+ CPPUNIT_ASSERT( q.size() == 1 );
+ CPPUNIT_ASSERT( q.push_with( []( int& dest ) { dest = 10; } ) );
+ CPPUNIT_ASSERT( !q.empty() );
+ CPPUNIT_ASSERT( q.size() == 2 );
+
+ it = -1;
+ CPPUNIT_ASSERT( q.pop_with( [&it]( int src ) { it = src; } ) );
+ CPPUNIT_ASSERT( it == 1 );
+ CPPUNIT_ASSERT( !q.empty() );
+ CPPUNIT_ASSERT( q.size() == 1 );
+ CPPUNIT_ASSERT( q.dequeue_with( [&it]( int src ) { it = src; } ) );
+ CPPUNIT_ASSERT( it == 10 );
+ CPPUNIT_ASSERT( q.size() == 0 );
+ CPPUNIT_ASSERT( q.empty() );
+ it += 2009;
+ nPrev = it;
+ CPPUNIT_ASSERT( !q.dequeue_with( [&it]( int src ) { it = src; } ) );
+ CPPUNIT_ASSERT( it == nPrev ); // it must not be changed!
+
+ CPPUNIT_ASSERT( q.size() == 0 );
+ CPPUNIT_ASSERT( q.empty() );
+ }
+ }
+
+ template <class Queue>
+ void test_emplace_ic( Queue& q )
+ {
+ int it = 0;
+ for ( size_t i = 0; i < 3; ++i ) {
+ CPPUNIT_ASSERT( q.emplace( (int) i * 10 ) );
+ CPPUNIT_ASSERT( !q.empty() );
+ CPPUNIT_ASSERT( q.size() == 1 );
+ CPPUNIT_ASSERT( q.pop( it ));
+ CPPUNIT_ASSERT( it == (int) i * 10 );
+ CPPUNIT_ASSERT( q.empty() );
+ CPPUNIT_ASSERT( q.size() == 0 );
+ }
+ }
+
+ public:
+ void MSQueue_HP();
+ void MSQueue_HP_relax();
+ void MSQueue_HP_seqcst();
+ void MSQueue_HP_relax_align();
+ void MSQueue_HP_seqcst_align();
+ void MSQueue_HP_Counted();
+ void MSQueue_HP_Counted_relax();
+ void MSQueue_HP_Counted_seqcst();
+ void MSQueue_HP_Counted_relax_align();
+ void MSQueue_HP_Counted_seqcst_align();
+
+ void MSQueue_DHP();
+ void MSQueue_DHP_relax();
+ void MSQueue_DHP_seqcst();
+ void MSQueue_DHP_relax_align();
+ void MSQueue_DHP_seqcst_align();
+ void MSQueue_DHP_Counted();
+ void MSQueue_DHP_Counted_relax();
+ void MSQueue_DHP_Counted_seqcst();
+ void MSQueue_DHP_Counted_relax_align();
+ void MSQueue_DHP_Counted_seqcst_align();
+
+ void MoirQueue_HP();
+ void MoirQueue_HP_relax();
+ void MoirQueue_HP_seqcst();
+ void MoirQueue_HP_relax_align();
+ void MoirQueue_HP_seqcst_align();
+ void MoirQueue_HP_Counted();
+ void MoirQueue_HP_Counted_relax();
+ void MoirQueue_HP_Counted_seqcst();
+ void MoirQueue_HP_Counted_relax_align();
+ void MoirQueue_HP_Counted_seqcst_align();
+
+ void MoirQueue_DHP();
+ void MoirQueue_DHP_relax();
+ void MoirQueue_DHP_seqcst();
+ void MoirQueue_DHP_relax_align();
+ void MoirQueue_DHP_seqcst_align();
+ void MoirQueue_DHP_Counted();
+ void MoirQueue_DHP_Counted_relax();
+ void MoirQueue_DHP_Counted_seqcst();
+ void MoirQueue_DHP_Counted_relax_align();
+ void MoirQueue_DHP_Counted_seqcst_align();
+
+/*
+ void OptimisticQueue_HP();
+ void OptimisticQueue_HP_relax();
+ void OptimisticQueue_HP_seqcst();
+ void OptimisticQueue_HP_relax_align();
+ void OptimisticQueue_HP_seqcst_align();
+ void OptimisticQueue_HP_Counted();
+ void OptimisticQueue_HP_Counted_relax();
+ void OptimisticQueue_HP_Counted_seqcst();
+ void OptimisticQueue_HP_Counted_relax_align();
+ void OptimisticQueue_HP_Counted_seqcst_align();
+
+ void OptimisticQueue_DHP();
+ void OptimisticQueue_DHP_relax();
+ void OptimisticQueue_DHP_seqcst();
+ void OptimisticQueue_DHP_relax_align();
+ void OptimisticQueue_DHP_seqcst_align();
+ void OptimisticQueue_DHP_Counted();
+ void OptimisticQueue_DHP_Counted_relax();
+ void OptimisticQueue_DHP_Counted_seqcst();
+ void OptimisticQueue_DHP_Counted_relax_align();
+ void OptimisticQueue_DHP_Counted_seqcst_align();
+
+ void BasketQueue_HP();
+ void BasketQueue_HP_relax();
+ void BasketQueue_HP_seqcst();
+ void BasketQueue_HP_relax_align();
+ void BasketQueue_HP_seqcst_align();
+ void BasketQueue_HP_Counted();
+ void BasketQueue_HP_Counted_relax();
+ void BasketQueue_HP_Counted_seqcst();
+ void BasketQueue_HP_Counted_relax_align();
+ void BasketQueue_HP_Counted_seqcst_align();
+
+ void BasketQueue_DHP();
+ void BasketQueue_DHP_relax();
+ void BasketQueue_DHP_seqcst();
+ void BasketQueue_DHP_relax_align();
+ void BasketQueue_DHP_seqcst_align();
+ void BasketQueue_DHP_Counted();
+ void BasketQueue_DHP_Counted_relax();
+ void BasketQueue_DHP_Counted_seqcst();
+ void BasketQueue_DHP_Counted_relax_align();
+ void BasketQueue_DHP_Counted_seqcst_align();
+
+ void FCQueue_deque();
+ void FCQueue_deque_elimination();
+ void FCQueue_deque_mutex();
+ void FCQueue_deque_stat();
+ void FCQueue_list();
+ void FCQueue_list_elimination();
+ void FCQueue_list_mutex();
+ void FCQueue_list_stat();
+
+ void Vyukov_MPMCCyclicQueue();
+ void Vyukov_MPMCCyclicQueue_Counted();
+
+ void RWQueue_();
+ void RWQueue_Counted();
+*/
+
+ CPPUNIT_TEST_SUITE( HdrTestQueue )
+ CPPUNIT_TEST(MSQueue_HP);
+ CPPUNIT_TEST(MSQueue_HP_relax);
+ CPPUNIT_TEST(MSQueue_HP_seqcst);
+ CPPUNIT_TEST(MSQueue_HP_relax_align);
+ CPPUNIT_TEST(MSQueue_HP_seqcst_align);
+ CPPUNIT_TEST(MSQueue_HP_Counted);
+ CPPUNIT_TEST(MSQueue_HP_Counted_relax);
+ CPPUNIT_TEST(MSQueue_HP_Counted_seqcst);
+ CPPUNIT_TEST(MSQueue_HP_Counted_relax_align);
+ CPPUNIT_TEST(MSQueue_HP_Counted_seqcst_align);
+
+ CPPUNIT_TEST(MSQueue_DHP);
+ CPPUNIT_TEST(MSQueue_DHP_relax);
+ CPPUNIT_TEST(MSQueue_DHP_seqcst);
+ CPPUNIT_TEST(MSQueue_DHP_relax_align);
+ CPPUNIT_TEST(MSQueue_DHP_seqcst_align);
+ CPPUNIT_TEST(MSQueue_DHP_Counted);
+ CPPUNIT_TEST(MSQueue_DHP_Counted_relax);
+ CPPUNIT_TEST(MSQueue_DHP_Counted_seqcst);
+ CPPUNIT_TEST(MSQueue_DHP_Counted_relax_align);
+ CPPUNIT_TEST(MSQueue_DHP_Counted_seqcst_align);
+
+ CPPUNIT_TEST(MoirQueue_HP);
+ CPPUNIT_TEST(MoirQueue_HP_relax);
+ CPPUNIT_TEST(MoirQueue_HP_seqcst);
+ CPPUNIT_TEST(MoirQueue_HP_relax_align);
+ CPPUNIT_TEST(MoirQueue_HP_seqcst_align);
+ CPPUNIT_TEST(MoirQueue_HP_Counted);
+ CPPUNIT_TEST(MoirQueue_HP_Counted_relax);
+ CPPUNIT_TEST(MoirQueue_HP_Counted_seqcst);
+ CPPUNIT_TEST(MoirQueue_HP_Counted_relax_align);
+ CPPUNIT_TEST(MoirQueue_HP_Counted_seqcst_align);
+
+ CPPUNIT_TEST(MoirQueue_DHP);
+ CPPUNIT_TEST(MoirQueue_DHP_relax);
+ CPPUNIT_TEST(MoirQueue_DHP_seqcst);
+ CPPUNIT_TEST(MoirQueue_DHP_relax_align);
+ CPPUNIT_TEST(MoirQueue_DHP_seqcst_align);
+ CPPUNIT_TEST(MoirQueue_DHP_Counted);
+ CPPUNIT_TEST(MoirQueue_DHP_Counted_relax);
+ CPPUNIT_TEST(MoirQueue_DHP_Counted_seqcst);
+ CPPUNIT_TEST(MoirQueue_DHP_Counted_relax_align);
+ CPPUNIT_TEST(MoirQueue_DHP_Counted_seqcst_align);
+/*
+ CPPUNIT_TEST(OptimisticQueue_HP);
+ CPPUNIT_TEST(OptimisticQueue_HP_relax);
+ CPPUNIT_TEST(OptimisticQueue_HP_seqcst);
+ CPPUNIT_TEST(OptimisticQueue_HP_relax_align);
+ CPPUNIT_TEST(OptimisticQueue_HP_seqcst_align);
+ CPPUNIT_TEST(OptimisticQueue_HP_Counted);
+ CPPUNIT_TEST(OptimisticQueue_HP_Counted_relax);
+ CPPUNIT_TEST(OptimisticQueue_HP_Counted_seqcst);
+ CPPUNIT_TEST(OptimisticQueue_HP_Counted_relax_align);
+ CPPUNIT_TEST(OptimisticQueue_HP_Counted_seqcst_align);
+
+ CPPUNIT_TEST(OptimisticQueue_DHP);
+ CPPUNIT_TEST(OptimisticQueue_DHP_relax);
+ CPPUNIT_TEST(OptimisticQueue_DHP_seqcst);
+ CPPUNIT_TEST(OptimisticQueue_DHP_relax_align);
+ CPPUNIT_TEST(OptimisticQueue_DHP_seqcst_align);
+ CPPUNIT_TEST(OptimisticQueue_DHP_Counted);
+ CPPUNIT_TEST(OptimisticQueue_DHP_Counted_relax);
+ CPPUNIT_TEST(OptimisticQueue_DHP_Counted_seqcst);
+ CPPUNIT_TEST(OptimisticQueue_DHP_Counted_relax_align);
+ CPPUNIT_TEST(OptimisticQueue_DHP_Counted_seqcst_align);
+
+ CPPUNIT_TEST(BasketQueue_HP);
+ CPPUNIT_TEST(BasketQueue_HP_relax);
+ CPPUNIT_TEST(BasketQueue_HP_seqcst);
+ CPPUNIT_TEST(BasketQueue_HP_relax_align);
+ CPPUNIT_TEST(BasketQueue_HP_seqcst_align);
+ CPPUNIT_TEST(BasketQueue_HP_Counted);
+ CPPUNIT_TEST(BasketQueue_HP_Counted_relax);
+ CPPUNIT_TEST(BasketQueue_HP_Counted_seqcst);
+ CPPUNIT_TEST(BasketQueue_HP_Counted_relax_align);
+ CPPUNIT_TEST(BasketQueue_HP_Counted_seqcst_align);
+
+ CPPUNIT_TEST(BasketQueue_DHP);
+ CPPUNIT_TEST(BasketQueue_DHP_relax);
+ CPPUNIT_TEST(BasketQueue_DHP_seqcst);
+ CPPUNIT_TEST(BasketQueue_DHP_relax_align);
+ CPPUNIT_TEST(BasketQueue_DHP_seqcst_align);
+ CPPUNIT_TEST(BasketQueue_DHP_Counted);
+ CPPUNIT_TEST(BasketQueue_DHP_Counted_relax);
+ CPPUNIT_TEST(BasketQueue_DHP_Counted_seqcst);
+ CPPUNIT_TEST(BasketQueue_DHP_Counted_relax_align);
+ CPPUNIT_TEST(BasketQueue_DHP_Counted_seqcst_align);
+
+ CPPUNIT_TEST(FCQueue_deque)
+ CPPUNIT_TEST(FCQueue_deque_elimination)
+ CPPUNIT_TEST(FCQueue_deque_mutex)
+ CPPUNIT_TEST(FCQueue_deque_stat)
+ CPPUNIT_TEST(FCQueue_list)
+ CPPUNIT_TEST(FCQueue_list_elimination)
+ CPPUNIT_TEST(FCQueue_list_mutex)
+ CPPUNIT_TEST(FCQueue_list_stat)
+
+ CPPUNIT_TEST(RWQueue_);
+ CPPUNIT_TEST(RWQueue_Counted);
+
+ CPPUNIT_TEST(Vyukov_MPMCCyclicQueue);
+ CPPUNIT_TEST(Vyukov_MPMCCyclicQueue_Counted);
+*/
+ CPPUNIT_TEST_SUITE_END();
+
+ };
+} // namespace queue
+
+#endif // #ifndef __CDSUNIT_QUEUE_HDR_H
--- /dev/null
+//$$CDS-header$$
+
+#include "hdr_intrusive_msqueue.h"
+#include "hdr_intrusive_segmented_queue.h"
+#include "hdr_queue_new.h"
+#include "hdr_queue.h" //TODO must be removed after refactoring
+#include "hdr_segmented_queue.h"
+
+CPPUNIT_TEST_SUITE_REGISTRATION( queue::HdrTestQueue );
+CPPUNIT_TEST_SUITE_REGISTRATION( queue::Queue_TestHeader); //TODO must be removed after refactoring
+CPPUNIT_TEST_SUITE_REGISTRATION( queue::HdrSegmentedQueue );
+CPPUNIT_TEST_SUITE_REGISTRATION( queue::IntrusiveQueueHeaderTest );
+CPPUNIT_TEST_SUITE_REGISTRATION( queue::HdrIntrusiveSegmentedQueue );
#include <cds/container/rwqueue.h>
-#include "queue/queue_test_header.h"
+#include "queue/hdr_queue.h"
namespace queue {
void Queue_TestHeader::RWQueue_()
}
} // namespace queue
-
-CPPUNIT_TEST_SUITE_REGISTRATION(queue::HdrSegmentedQueue);
#include <cds/container/vyukov_mpmc_cycle_queue.h>
-#include "queue/queue_test_header.h"
+#include "queue/hdr_queue.h"
namespace queue {
namespace {
+++ /dev/null
-//$$CDS-header$$
-
-#include "queue/queue_test_header.h"
-CPPUNIT_TEST_SUITE_REGISTRATION(queue::Queue_TestHeader);
+++ /dev/null
-//$$CDS-header$$
-
-#ifndef __UNIT_QUEUE_SIMPLE_H
-#define __UNIT_QUEUE_SIMPLE_H
-
-#include "cppunit/cppunit_proxy.h"
-#include <cds/details/defs.h>
-
-namespace queue {
-
- //
- // Test queue operation in single thread mode
- //
- class Queue_TestHeader: public CppUnitMini::TestCase
- {
- protected:
- template <class Queue>
- void testNoItemCounter()
- {
- Queue q;
- test_with( q );
- test_emplace( q );
- }
-
- template <class Queue>
- void test_with( Queue& q )
- {
- int it;
- int nPrev;
-
- for ( size_t i = 0; i < 3; ++i ) {
- CPPUNIT_ASSERT( q.empty() );
-#ifndef _DEBUG
- CPPUNIT_ASSERT( q.size() == 0 );
-#endif
- CPPUNIT_ASSERT( q.enqueue( 1 ) );
- CPPUNIT_ASSERT( !q.empty() );
- CPPUNIT_ASSERT( q.push( 10 ) );
- CPPUNIT_ASSERT( !q.empty() );
-#ifndef _DEBUG
- CPPUNIT_ASSERT( q.size() == 0 ) ; // no queue's item counter!
-#endif
-
- it = -1;
- CPPUNIT_ASSERT( q.pop( it ) );
- CPPUNIT_ASSERT( it == 1 );
- CPPUNIT_ASSERT( !q.empty() );
- CPPUNIT_ASSERT( q.dequeue( it ) );
- CPPUNIT_ASSERT( it == 10 );
-#ifndef _DEBUG
- CPPUNIT_ASSERT( q.size() == 0 );
-#endif
- CPPUNIT_ASSERT( q.empty() );
- it += 2009;
- nPrev = it;
- CPPUNIT_ASSERT( !q.dequeue( it ) );
- CPPUNIT_ASSERT( it == nPrev ) ; // it must not be changed!
- }
- }
-
- template <class Queue>
- void test_emplace( Queue& q )
- {
- int it;
- for ( size_t i = 0; i < 3; ++i ) {
- CPPUNIT_ASSERT( q.emplace( static_cast<int>( i * 42 )) );
- CPPUNIT_ASSERT( !q.empty() );
- it = -1;
- CPPUNIT_ASSERT( q.pop( it ));
- CPPUNIT_ASSERT( it == static_cast<int>( i * 42 ));
- CPPUNIT_ASSERT( q.empty() );
- }
- }
-
- template <class Queue>
- void testWithItemCounter()
- {
- Queue q;
- test_ic_with( q );
- test_emplace_ic( q );
- }
-
- template <class Queue>
- void testFCQueue()
- {
- Queue q;
- test_ic_with( q );
- }
-
- template <class Queue>
- void test_ic_with( Queue& q )
- {
- int it;
- int nPrev;
-
- for ( size_t i = 0; i < 3; ++i ) {
- CPPUNIT_ASSERT( q.empty() );
- CPPUNIT_ASSERT( q.size() == 0 );
- CPPUNIT_ASSERT( q.enqueue( 1 ) );
- CPPUNIT_ASSERT( q.size() == 1 );
- CPPUNIT_ASSERT( !q.empty() );
- CPPUNIT_ASSERT( q.push( 10 ) );
- CPPUNIT_ASSERT( !q.empty() );
- CPPUNIT_ASSERT( q.size() == 2 );
-
- it = -1;
- CPPUNIT_ASSERT( q.pop( it ) );
- CPPUNIT_ASSERT( it == 1 );
- CPPUNIT_ASSERT( !q.empty() );
- CPPUNIT_ASSERT( q.size() == 1 );
- CPPUNIT_ASSERT( q.dequeue( it ) );
- CPPUNIT_ASSERT( it == 10 );
- CPPUNIT_ASSERT( q.size() == 0 );
- CPPUNIT_ASSERT( q.empty() );
- CPPUNIT_ASSERT( q.size() == 0 );
- it += 2009;
- nPrev = it;
- CPPUNIT_ASSERT( !q.dequeue( it ) );
- CPPUNIT_ASSERT( it == nPrev ) ; // it must not be changed!
-
- CPPUNIT_ASSERT( q.empty() );
- CPPUNIT_ASSERT( q.size() == 0 );
- }
- }
-
- template <class Queue>
- void test_emplace_ic( Queue& q )
- {
- int it = 0;
- for ( size_t i = 0; i < 3; ++i ) {
- CPPUNIT_ASSERT( q.emplace( (int) i * 10 ) );
- CPPUNIT_ASSERT( !q.empty() );
- CPPUNIT_ASSERT( q.size() == 1 );
- CPPUNIT_ASSERT( q.pop( it ));
- CPPUNIT_ASSERT( it == (int) i * 10 );
- CPPUNIT_ASSERT( q.empty() );
- CPPUNIT_ASSERT( q.size() == 0 );
- }
- }
-
- public:
- void MSQueue_HP();
- void MSQueue_HP_relax();
- void MSQueue_HP_seqcst();
- void MSQueue_HP_relax_align();
- void MSQueue_HP_seqcst_align();
- void MSQueue_HP_Counted();
- void MSQueue_HP_Counted_relax();
- void MSQueue_HP_Counted_seqcst();
- void MSQueue_HP_Counted_relax_align();
- void MSQueue_HP_Counted_seqcst_align();
-
- void MSQueue_HRC();
- void MSQueue_HRC_relax();
- void MSQueue_HRC_seqcst();
- void MSQueue_HRC_relax_align();
- void MSQueue_HRC_seqcst_align();
- void MSQueue_HRC_Counted();
- void MSQueue_HRC_Counted_relax();
- void MSQueue_HRC_Counted_seqcst();
- void MSQueue_HRC_Counted_relax_align();
- void MSQueue_HRC_Counted_seqcst_align();
-
- void MSQueue_PTB();
- void MSQueue_PTB_relax();
- void MSQueue_PTB_seqcst();
- void MSQueue_PTB_relax_align();
- void MSQueue_PTB_seqcst_align();
- void MSQueue_PTB_Counted();
- void MSQueue_PTB_Counted_relax();
- void MSQueue_PTB_Counted_seqcst();
- void MSQueue_PTB_Counted_relax_align();
- void MSQueue_PTB_Counted_seqcst_align();
-
- void MoirQueue_HP();
- void MoirQueue_HP_relax();
- void MoirQueue_HP_seqcst();
- void MoirQueue_HP_relax_align();
- void MoirQueue_HP_seqcst_align();
- void MoirQueue_HP_Counted();
- void MoirQueue_HP_Counted_relax();
- void MoirQueue_HP_Counted_seqcst();
- void MoirQueue_HP_Counted_relax_align();
- void MoirQueue_HP_Counted_seqcst_align();
-
- void MoirQueue_HRC();
- void MoirQueue_HRC_relax();
- void MoirQueue_HRC_seqcst();
- void MoirQueue_HRC_relax_align();
- void MoirQueue_HRC_seqcst_align();
- void MoirQueue_HRC_Counted();
- void MoirQueue_HRC_Counted_relax();
- void MoirQueue_HRC_Counted_seqcst();
- void MoirQueue_HRC_Counted_relax_align();
- void MoirQueue_HRC_Counted_seqcst_align();
-
- void MoirQueue_PTB();
- void MoirQueue_PTB_relax();
- void MoirQueue_PTB_seqcst();
- void MoirQueue_PTB_relax_align();
- void MoirQueue_PTB_seqcst_align();
- void MoirQueue_PTB_Counted();
- void MoirQueue_PTB_Counted_relax();
- void MoirQueue_PTB_Counted_seqcst();
- void MoirQueue_PTB_Counted_relax_align();
- void MoirQueue_PTB_Counted_seqcst_align();
-
- void OptimisticQueue_HP();
- void OptimisticQueue_HP_relax();
- void OptimisticQueue_HP_seqcst();
- void OptimisticQueue_HP_relax_align();
- void OptimisticQueue_HP_seqcst_align();
- void OptimisticQueue_HP_Counted();
- void OptimisticQueue_HP_Counted_relax();
- void OptimisticQueue_HP_Counted_seqcst();
- void OptimisticQueue_HP_Counted_relax_align();
- void OptimisticQueue_HP_Counted_seqcst_align();
-
- void OptimisticQueue_PTB();
- void OptimisticQueue_PTB_relax();
- void OptimisticQueue_PTB_seqcst();
- void OptimisticQueue_PTB_relax_align();
- void OptimisticQueue_PTB_seqcst_align();
- void OptimisticQueue_PTB_Counted();
- void OptimisticQueue_PTB_Counted_relax();
- void OptimisticQueue_PTB_Counted_seqcst();
- void OptimisticQueue_PTB_Counted_relax_align();
- void OptimisticQueue_PTB_Counted_seqcst_align();
-
- void BasketQueue_HP();
- void BasketQueue_HP_relax();
- void BasketQueue_HP_seqcst();
- void BasketQueue_HP_relax_align();
- void BasketQueue_HP_seqcst_align();
- void BasketQueue_HP_Counted();
- void BasketQueue_HP_Counted_relax();
- void BasketQueue_HP_Counted_seqcst();
- void BasketQueue_HP_Counted_relax_align();
- void BasketQueue_HP_Counted_seqcst_align();
-
- void BasketQueue_HRC();
- void BasketQueue_HRC_relax();
- void BasketQueue_HRC_seqcst();
- void BasketQueue_HRC_relax_align();
- void BasketQueue_HRC_seqcst_align();
- void BasketQueue_HRC_Counted();
- void BasketQueue_HRC_Counted_relax();
- void BasketQueue_HRC_Counted_seqcst();
- void BasketQueue_HRC_Counted_relax_align();
- void BasketQueue_HRC_Counted_seqcst_align();
-
- void BasketQueue_PTB();
- void BasketQueue_PTB_relax();
- void BasketQueue_PTB_seqcst();
- void BasketQueue_PTB_relax_align();
- void BasketQueue_PTB_seqcst_align();
- void BasketQueue_PTB_Counted();
- void BasketQueue_PTB_Counted_relax();
- void BasketQueue_PTB_Counted_seqcst();
- void BasketQueue_PTB_Counted_relax_align();
- void BasketQueue_PTB_Counted_seqcst_align();
-
- void FCQueue_deque();
- void FCQueue_deque_elimination();
- void FCQueue_deque_mutex();
- void FCQueue_deque_stat();
- void FCQueue_list();
- void FCQueue_list_elimination();
- void FCQueue_list_mutex();
- void FCQueue_list_stat();
-
- void Vyukov_MPMCCyclicQueue();
- void Vyukov_MPMCCyclicQueue_Counted();
-
- void RWQueue_();
- void RWQueue_Counted();
-
- CPPUNIT_TEST_SUITE(Queue_TestHeader)
- CPPUNIT_TEST(MSQueue_HP);
- CPPUNIT_TEST(MSQueue_HP_relax);
- CPPUNIT_TEST(MSQueue_HP_seqcst);
- CPPUNIT_TEST(MSQueue_HP_relax_align);
- CPPUNIT_TEST(MSQueue_HP_seqcst_align);
- CPPUNIT_TEST(MSQueue_HP_Counted);
- CPPUNIT_TEST(MSQueue_HP_Counted_relax);
- CPPUNIT_TEST(MSQueue_HP_Counted_seqcst);
- CPPUNIT_TEST(MSQueue_HP_Counted_relax_align);
- CPPUNIT_TEST(MSQueue_HP_Counted_seqcst_align);
-
- CPPUNIT_TEST(MSQueue_HRC);
- CPPUNIT_TEST(MSQueue_HRC_relax);
- CPPUNIT_TEST(MSQueue_HRC_seqcst);
- CPPUNIT_TEST(MSQueue_HRC_relax_align);
- CPPUNIT_TEST(MSQueue_HRC_seqcst_align);
- CPPUNIT_TEST(MSQueue_HRC_Counted);
- CPPUNIT_TEST(MSQueue_HRC_Counted_relax);
- CPPUNIT_TEST(MSQueue_HRC_Counted_seqcst);
- CPPUNIT_TEST(MSQueue_HRC_Counted_relax_align);
- CPPUNIT_TEST(MSQueue_HRC_Counted_seqcst_align);
-
- CPPUNIT_TEST(MSQueue_PTB);
- CPPUNIT_TEST(MSQueue_PTB_relax);
- CPPUNIT_TEST(MSQueue_PTB_seqcst);
- CPPUNIT_TEST(MSQueue_PTB_relax_align);
- CPPUNIT_TEST(MSQueue_PTB_seqcst_align);
- CPPUNIT_TEST(MSQueue_PTB_Counted);
- CPPUNIT_TEST(MSQueue_PTB_Counted_relax);
- CPPUNIT_TEST(MSQueue_PTB_Counted_seqcst);
- CPPUNIT_TEST(MSQueue_PTB_Counted_relax_align);
- CPPUNIT_TEST(MSQueue_PTB_Counted_seqcst_align);
-
- CPPUNIT_TEST(MoirQueue_HP);
- CPPUNIT_TEST(MoirQueue_HP_relax);
- CPPUNIT_TEST(MoirQueue_HP_seqcst);
- CPPUNIT_TEST(MoirQueue_HP_relax_align);
- CPPUNIT_TEST(MoirQueue_HP_seqcst_align);
- CPPUNIT_TEST(MoirQueue_HP_Counted);
- CPPUNIT_TEST(MoirQueue_HP_Counted_relax);
- CPPUNIT_TEST(MoirQueue_HP_Counted_seqcst);
- CPPUNIT_TEST(MoirQueue_HP_Counted_relax_align);
- CPPUNIT_TEST(MoirQueue_HP_Counted_seqcst_align);
-
- CPPUNIT_TEST(MoirQueue_HRC);
- CPPUNIT_TEST(MoirQueue_HRC_relax);
- CPPUNIT_TEST(MoirQueue_HRC_seqcst);
- CPPUNIT_TEST(MoirQueue_HRC_relax_align);
- CPPUNIT_TEST(MoirQueue_HRC_seqcst_align);
- CPPUNIT_TEST(MoirQueue_HRC_Counted);
- CPPUNIT_TEST(MoirQueue_HRC_Counted_relax);
- CPPUNIT_TEST(MoirQueue_HRC_Counted_seqcst);
- CPPUNIT_TEST(MoirQueue_HRC_Counted_relax_align);
- CPPUNIT_TEST(MoirQueue_HRC_Counted_seqcst_align);
-
- CPPUNIT_TEST(MoirQueue_PTB);
- CPPUNIT_TEST(MoirQueue_PTB_relax);
- CPPUNIT_TEST(MoirQueue_PTB_seqcst);
- CPPUNIT_TEST(MoirQueue_PTB_relax_align);
- CPPUNIT_TEST(MoirQueue_PTB_seqcst_align);
- CPPUNIT_TEST(MoirQueue_PTB_Counted);
- CPPUNIT_TEST(MoirQueue_PTB_Counted_relax);
- CPPUNIT_TEST(MoirQueue_PTB_Counted_seqcst);
- CPPUNIT_TEST(MoirQueue_PTB_Counted_relax_align);
- CPPUNIT_TEST(MoirQueue_PTB_Counted_seqcst_align);
-
- CPPUNIT_TEST(OptimisticQueue_HP);
- CPPUNIT_TEST(OptimisticQueue_HP_relax);
- CPPUNIT_TEST(OptimisticQueue_HP_seqcst);
- CPPUNIT_TEST(OptimisticQueue_HP_relax_align);
- CPPUNIT_TEST(OptimisticQueue_HP_seqcst_align);
- CPPUNIT_TEST(OptimisticQueue_HP_Counted);
- CPPUNIT_TEST(OptimisticQueue_HP_Counted_relax);
- CPPUNIT_TEST(OptimisticQueue_HP_Counted_seqcst);
- CPPUNIT_TEST(OptimisticQueue_HP_Counted_relax_align);
- CPPUNIT_TEST(OptimisticQueue_HP_Counted_seqcst_align);
-
- CPPUNIT_TEST(OptimisticQueue_PTB);
- CPPUNIT_TEST(OptimisticQueue_PTB_relax);
- CPPUNIT_TEST(OptimisticQueue_PTB_seqcst);
- CPPUNIT_TEST(OptimisticQueue_PTB_relax_align);
- CPPUNIT_TEST(OptimisticQueue_PTB_seqcst_align);
- CPPUNIT_TEST(OptimisticQueue_PTB_Counted);
- CPPUNIT_TEST(OptimisticQueue_PTB_Counted_relax);
- CPPUNIT_TEST(OptimisticQueue_PTB_Counted_seqcst);
- CPPUNIT_TEST(OptimisticQueue_PTB_Counted_relax_align);
- CPPUNIT_TEST(OptimisticQueue_PTB_Counted_seqcst_align);
-
- CPPUNIT_TEST(BasketQueue_HP);
- CPPUNIT_TEST(BasketQueue_HP_relax);
- CPPUNIT_TEST(BasketQueue_HP_seqcst);
- CPPUNIT_TEST(BasketQueue_HP_relax_align);
- CPPUNIT_TEST(BasketQueue_HP_seqcst_align);
- CPPUNIT_TEST(BasketQueue_HP_Counted);
- CPPUNIT_TEST(BasketQueue_HP_Counted_relax);
- CPPUNIT_TEST(BasketQueue_HP_Counted_seqcst);
- CPPUNIT_TEST(BasketQueue_HP_Counted_relax_align);
- CPPUNIT_TEST(BasketQueue_HP_Counted_seqcst_align);
-
- CPPUNIT_TEST(BasketQueue_HRC);
- CPPUNIT_TEST(BasketQueue_HRC_relax);
- CPPUNIT_TEST(BasketQueue_HRC_seqcst);
- CPPUNIT_TEST(BasketQueue_HRC_relax_align);
- CPPUNIT_TEST(BasketQueue_HRC_seqcst_align);
- CPPUNIT_TEST(BasketQueue_HRC_Counted);
- CPPUNIT_TEST(BasketQueue_HRC_Counted_relax);
- CPPUNIT_TEST(BasketQueue_HRC_Counted_seqcst);
- CPPUNIT_TEST(BasketQueue_HRC_Counted_relax_align);
- CPPUNIT_TEST(BasketQueue_HRC_Counted_seqcst_align);
-
- CPPUNIT_TEST(BasketQueue_PTB);
- CPPUNIT_TEST(BasketQueue_PTB_relax);
- CPPUNIT_TEST(BasketQueue_PTB_seqcst);
- CPPUNIT_TEST(BasketQueue_PTB_relax_align);
- CPPUNIT_TEST(BasketQueue_PTB_seqcst_align);
- CPPUNIT_TEST(BasketQueue_PTB_Counted);
- CPPUNIT_TEST(BasketQueue_PTB_Counted_relax);
- CPPUNIT_TEST(BasketQueue_PTB_Counted_seqcst);
- CPPUNIT_TEST(BasketQueue_PTB_Counted_relax_align);
- CPPUNIT_TEST(BasketQueue_PTB_Counted_seqcst_align);
-
- CPPUNIT_TEST(FCQueue_deque)
- CPPUNIT_TEST(FCQueue_deque_elimination)
- CPPUNIT_TEST(FCQueue_deque_mutex)
- CPPUNIT_TEST(FCQueue_deque_stat)
- CPPUNIT_TEST(FCQueue_list)
- CPPUNIT_TEST(FCQueue_list_elimination)
- CPPUNIT_TEST(FCQueue_list_mutex)
- CPPUNIT_TEST(FCQueue_list_stat)
-
- CPPUNIT_TEST(RWQueue_);
- CPPUNIT_TEST(RWQueue_Counted);
-
- CPPUNIT_TEST(Vyukov_MPMCCyclicQueue);
- CPPUNIT_TEST(Vyukov_MPMCCyclicQueue_Counted);
- CPPUNIT_TEST_SUITE_END();
-
- };
-} // namespace queue
-
-#endif // #ifndef __UNIT_QUEUE_SIMPLE_H
<< "\t\t Bad tail: " << s.m_BadTail.get() << "\n";
}
- static inline std::ostream& operator <<( std::ostream& o, cds::intrusive::queue_dummy_stat const& s )
+ static inline std::ostream& operator <<( std::ostream& o, cds::intrusive::msqueue::empty_stat const& s )
{
return o;
}