| 120 | |
| 121 | template <class Queue> |
| 122 | void test( Queue& q ) |
| 123 | { |
| 124 | cds_test::thread_pool& pool = get_pool(); |
| 125 | |
| 126 | pool.add( new Consumer<Queue>( pool, q ), s_nThreadCount ); |
| 127 | |
| 128 | for ( size_t i = 0; i < s_nQueueSize; ++i ) |
| 129 | q.push( i ); |
| 130 | |
| 131 | propout() << std::make_pair( "thread_count", s_nThreadCount ) |
| 132 | << std::make_pair( "push_count", s_nQueueSize ); |
| 133 | |
| 134 | std::chrono::milliseconds duration = pool.run(); |
| 135 | |
| 136 | propout() << std::make_pair( "duration", duration ); |
| 137 | |
| 138 | analyze( q ); |
| 139 | |
| 140 | propout() << q.statistics(); |
| 141 | } |
| 142 | }; |
| 143 | |
| 144 | CDSSTRESS_MSQueue( queue_pop ) |