| 188 | |
| 189 | template <class Queue> |
| 190 | void test( Queue& q ) |
| 191 | { |
| 192 | size_t nThreadPushCount = s_nQueueSize / s_nThreadCount; |
| 193 | |
| 194 | cds_test::thread_pool& pool = get_pool(); |
| 195 | pool.add( new Strain<Queue>( pool, q, nThreadPushCount ), s_nThreadCount ); |
| 196 | |
| 197 | s_nQueueSize = nThreadPushCount * s_nThreadCount; |
| 198 | propout() << std::make_pair( "thread_count", s_nThreadCount ) |
| 199 | << std::make_pair( "push_count", s_nQueueSize ); |
| 200 | |
| 201 | s_nProducerCount.store( pool.size(), std::memory_order_release ); |
| 202 | std::chrono::milliseconds duration = pool.run(); |
| 203 | propout() << std::make_pair( "duration", duration ); |
| 204 | |
| 205 | analyze( q ); |
| 206 | |
| 207 | propout() << q.statistics(); |
| 208 | } |
| 209 | }; |
| 210 | |
| 211 | CDSSTRESS_MSQueue( queue_random ) |