File tree Expand file tree Collapse file tree 2 files changed +2
-14
lines changed
Expand file tree Collapse file tree 2 files changed +2
-14
lines changed Original file line number Diff line number Diff line change 1010#include < random.h>
1111#include < util/system.h>
1212
13- #include < boost/thread/thread.hpp>
14-
1513#include < vector>
1614
1715static const size_t BATCHES = 101 ;
@@ -44,12 +42,9 @@ static void CCheckQueueSpeedPrevectorJob(benchmark::Bench& bench)
4442 void swap (PrevectorJob& x){p.swap (x.p );};
4543 };
4644 CCheckQueue<PrevectorJob> queue {QUEUE_BATCH_SIZE};
47- boost::thread_group tg;
4845 // The main thread should be counted to prevent thread oversubscription, and
4946 // to decrease the variance of benchmark results.
50- for (auto x = 0 ; x < GetNumCores () - 1 ; ++x) {
51- tg.create_thread ([&]{queue.Thread ();});
52- }
47+ queue.StartWorkerThreads (GetNumCores () - 1 );
5348
5449 // create all the data once, then submit copies in the benchmark.
5550 FastRandomContext insecure_rand (true );
@@ -70,8 +65,7 @@ static void CCheckQueueSpeedPrevectorJob(benchmark::Bench& bench)
7065 // it is done explicitly here for clarity
7166 control.Wait ();
7267 });
73- tg.interrupt_all ();
74- tg.join_all ();
68+ queue.StopWorkerThreads ();
7569 ECC_Stop ();
7670}
7771BENCHMARK (CCheckQueueSpeedPrevectorJob);
Original file line number Diff line number Diff line change @@ -159,12 +159,6 @@ class CCheckQueue
159159 }
160160 }
161161
162- // ! Worker thread
163- void Thread ()
164- {
165- Loop (false /* worker thread */ );
166- }
167-
168162 // ! Wait until execution finishes, and return whether all evaluations were successful.
169163 bool Wait ()
170164 {
You can’t perform that action at this time.
0 commit comments