From: khizmax Date: Wed, 15 Jun 2016 21:02:16 +0000 (+0300) Subject: Improved queue stress test X-Git-Tag: v2.2.0~216 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=ff73952a77f968299f921f20def41af7abce8987;p=libcds.git Improved queue stress test --- diff --git a/test/stress/queue/push_pop.cpp b/test/stress/queue/push_pop.cpp index 5720172d..fd0db869 100644 --- a/test/stress/queue/push_pop.cpp +++ b/test/stress/queue/push_pop.cpp @@ -174,10 +174,9 @@ namespace { else ++m_nBadWriter; } - else + else { ++m_nPopEmpty; - if ( m_Queue.empty() ) { if ( s_nProducerDone.load() >= nTotalWriters ) { if ( m_Queue.empty() ) break; diff --git a/test/stress/queue/queue_type.h b/test/stress/queue/queue_type.h index c4178fef..4d7c3123 100644 --- a/test/stress/queue/queue_type.h +++ b/test/stress/queue/queue_type.h @@ -418,6 +418,11 @@ namespace queue { typedef cds::container::RWQueue< Value, traits_RWQueue_mutex > RWQueue_mutex; // FCQueue + struct traits_FCQueue_stat: + public cds::container::fcqueue::make_traits< + cds::opt::stat< cds::container::fcqueue::stat<> > + >::type + {}; struct traits_FCQueue_single_mutex_single_condvar: public cds::container::fcqueue::make_traits< cds::opt::wait_strategy< cds::algo::flat_combining::wait_strategy::single_mutex_single_condvar<>> @@ -458,6 +463,7 @@ namespace queue { {}; typedef cds::container::FCQueue< Value > FCQueue_deque; + typedef cds::container::FCQueue< Value, std::queue, traits_FCQueue_stat > FCQueue_deque_stat; typedef cds::container::FCQueue< Value, std::queue, traits_FCQueue_single_mutex_single_condvar> FCQueue_deque_wait_ss; typedef cds::container::FCQueue< Value, std::queue, traits_FCQueue_single_mutex_single_condvar_stat> FCQueue_deque_wait_ss_stat; typedef cds::container::FCQueue< Value, std::queue, traits_FCQueue_single_mutex_multi_condvar> FCQueue_deque_wait_sm; @@ -468,7 +474,8 @@ namespace queue { typedef cds::container::FCQueue< Value, std::queue, traits_FCQueue_elimination > FCQueue_deque_elimination; typedef cds::container::FCQueue< Value, std::queue, traits_FCQueue_elimination_stat > FCQueue_deque_elimination_stat; - typedef cds::container::FCQueue< Value, std::queue >> FCQueue_list; + typedef cds::container::FCQueue< Value, std::queue>> FCQueue_list; + typedef cds::container::FCQueue< Value, std::queue>, traits_FCQueue_stat> FCQueue_list_stat; typedef cds::container::FCQueue< Value, std::queue>, traits_FCQueue_single_mutex_single_condvar> FCQueue_list_wait_ss; typedef cds::container::FCQueue< Value, std::queue>, traits_FCQueue_single_mutex_single_condvar_stat> FCQueue_list_wait_ss_stat; typedef cds::container::FCQueue< Value, std::queue>, traits_FCQueue_single_mutex_multi_condvar> FCQueue_list_wait_sm; @@ -721,6 +728,7 @@ namespace cds_test { #define CDSSTRESS_FCQueue( test_fixture ) \ CDSSTRESS_Queue_F( test_fixture, FCQueue_deque ) \ + CDSSTRESS_Queue_F( test_fixture, FCQueue_deque_stat ) \ CDSSTRESS_Queue_F( test_fixture, FCQueue_deque_wait_ss ) \ CDSSTRESS_Queue_F( test_fixture, FCQueue_deque_wait_ss_stat ) \ CDSSTRESS_Queue_F( test_fixture, FCQueue_deque_wait_sm ) \ @@ -730,6 +738,7 @@ namespace cds_test { CDSSTRESS_Queue_F( test_fixture, FCQueue_deque_elimination ) \ CDSSTRESS_Queue_F( test_fixture, FCQueue_deque_elimination_stat ) \ CDSSTRESS_Queue_F( test_fixture, FCQueue_list ) \ + CDSSTRESS_Queue_F( test_fixture, FCQueue_list_stat ) \ CDSSTRESS_Queue_F( test_fixture, FCQueue_list_wait_ss ) \ CDSSTRESS_Queue_F( test_fixture, FCQueue_list_wait_ss_stat ) \ CDSSTRESS_Queue_F( test_fixture, FCQueue_list_wait_sm ) \