static size_t s_nConsumerThreadCount = 4;
static size_t s_nProducerThreadCount = 4;
static size_t s_nQueueSize = 4000000;
+ static size_t s_nVyukovQueueSize = 40000;
static size_t s_nHeavyValueSize = 100;
static std::atomic<size_t> s_nProducerDone( 0 );
{
cds_test::thread_pool& pool = get_pool();
- typedef Consumer<Queue> Consumer;
- typedef Producer<Queue> Producer;
+ typedef Consumer<Queue> consumer_type;
+ typedef Producer<Queue> producer_type;
size_t nPostTestPops = 0;
{
size_t nPoppedItems = 0;
size_t nPushFailed = 0;
- std::vector< Consumer * > arrConsumer;
+ std::vector< consumer_type * > arrConsumer;
for ( size_t i = 0; i < pool.size(); ++i ) {
cds_test::thread& thr = pool.get(i);
if ( thr.type() == consumer_thread ) {
- Consumer& consumer = static_cast<Consumer&>( thr );
+ consumer_type& consumer = static_cast<consumer_type&>( thr );
nTotalPops += consumer.m_nPopped;
nPopFalse += consumer.m_nPopEmpty;
arrConsumer.push_back( &consumer );
else {
assert( thr.type() == producer_thread );
- Producer& producer = static_cast<Producer&>( thr );
+ producer_type& producer = static_cast<producer_type&>( thr );
nPushFailed += producer.m_nPushFailed;
EXPECT_EQ( producer.m_nPushFailed, 0u ) << "producer_thread_no " << i;
}
s_nConsumerThreadCount = cfg.get_size_t( "ConsumerCount", s_nConsumerThreadCount );
s_nProducerThreadCount = cfg.get_size_t( "ProducerCount", s_nProducerThreadCount );
s_nQueueSize = cfg.get_size_t( "QueueSize", s_nQueueSize );
+ s_nVyukovQueueSize = cfg.get_size_t( "VyukovQueueSize", s_nVyukovQueueSize );
s_nHeavyValueSize = cfg.get_size_t( "HeavyValueSize", s_nHeavyValueSize );
if ( s_nConsumerThreadCount == 0u )
CDSSTRESS_MoirQueue( simple_queue_push_pop )
CDSSTRESS_BasketQueue( simple_queue_push_pop )
CDSSTRESS_OptimsticQueue( simple_queue_push_pop )
- CDSSTRESS_FCQueue( simple_queue_push_pop )
- CDSSTRESS_FCDeque( simple_queue_push_pop )
- CDSSTRESS_FCDeque_HeavyValue( fc_with_heavy_value )
CDSSTRESS_RWQueue( simple_queue_push_pop )
- CDSSTRESS_StdQueue( simple_queue_push_pop )
#undef CDSSTRESS_Queue_F
#define CDSSTRESS_Queue_F( test_fixture, type_name ) \
TEST_F( test_fixture, type_name ) \
{ \
+ size_t old_queue_size = s_nQueueSize; \
+ s_nQueueSize = s_nVyukovQueueSize; \
typedef queue::Types< value_type >::type_name queue_type; \
queue_type queue( s_nQueueSize ); \
test( queue ); \
+ s_nQueueSize = old_queue_size; \
}
CDSSTRESS_VyukovQueue( simple_queue_push_pop )
#else
INSTANTIATE_TEST_CASE_P( SQ,
segmented_queue_push_pop,
- ::testing::ValuesIn( segmented_queue_push_pop::get_test_parameters()) );
+ ::testing::ValuesIn( segmented_queue_push_pop::get_test_parameters()));
#endif
} // namespace