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 10
10
#include < random.h>
11
11
#include < util/system.h>
12
12
13
- #include < boost/thread/thread.hpp>
14
-
15
13
#include < vector>
16
14
17
15
static const size_t BATCHES = 101 ;
@@ -44,12 +42,9 @@ static void CCheckQueueSpeedPrevectorJob(benchmark::Bench& bench)
44
42
void swap (PrevectorJob& x){p.swap (x.p );};
45
43
};
46
44
CCheckQueue<PrevectorJob> queue {QUEUE_BATCH_SIZE};
47
- boost::thread_group tg;
48
45
// The main thread should be counted to prevent thread oversubscription, and
49
46
// 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 );
53
48
54
49
// create all the data once, then submit copies in the benchmark.
55
50
FastRandomContext insecure_rand (true );
@@ -70,8 +65,7 @@ static void CCheckQueueSpeedPrevectorJob(benchmark::Bench& bench)
70
65
// it is done explicitly here for clarity
71
66
control.Wait ();
72
67
});
73
- tg.interrupt_all ();
74
- tg.join_all ();
68
+ queue.StopWorkerThreads ();
75
69
ECC_Stop ();
76
70
}
77
71
BENCHMARK (CCheckQueueSpeedPrevectorJob);
Original file line number Diff line number Diff line change @@ -159,12 +159,6 @@ class CCheckQueue
159
159
}
160
160
}
161
161
162
- // ! Worker thread
163
- void Thread ()
164
- {
165
- Loop (false /* worker thread */ );
166
- }
167
-
168
162
// ! Wait until execution finishes, and return whether all evaluations were successful.
169
163
bool Wait ()
170
164
{
You can’t perform that action at this time.
0 commit comments