MCPcopy Create free account
hub / github.com/bcndev/bytecoin / BlockPreparatorMulticore

Method BlockPreparatorMulticore

src/Core/Multicore.cpp:15–23  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13using namespace cn;
14
15BlockPreparatorMulticore::BlockPreparatorMulticore(const Currency &currency, platform::EventLoop *main_loop)
16 : currency(currency), main_loop(main_loop) {
17 auto th_count = std::max<size_t>(2, 3 * std::thread::hardware_concurrency() / 4);
18 // we use more energy but have the same speed when using hyperthreading
19 // std::cout << "Starting multicore ring checker using " << th_count << "/" << std::thread::hardware_concurrency()
20 // << " cpus" << std::endl;
21 for (size_t i = 0; i != th_count; ++i)
22 threads.emplace_back(&BlockPreparatorMulticore::thread_run, this);
23}
24BlockPreparatorMulticore::~BlockPreparatorMulticore() {
25 {
26 std::unique_lock<std::mutex> lock(mu);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected