Skip to content

Commit 6784ac4

Browse files
committed
bench: Use CCheckQueue local thread pool
1 parent dba3069 commit 6784ac4

File tree

2 files changed

+2
-14
lines changed

2 files changed

+2
-14
lines changed

src/bench/checkqueue.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
#include <random.h>
1111
#include <util/system.h>
1212

13-
#include <boost/thread/thread.hpp>
14-
1513
#include <vector>
1614

1715
static 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
}
7771
BENCHMARK(CCheckQueueSpeedPrevectorJob);

src/checkqueue.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff 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
{

0 commit comments

Comments
 (0)