| 13 | using namespace cn; |
| 14 | |
| 15 | BlockPreparatorMulticore::BlockPreparatorMulticore(const Currency ¤cy, 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 | } |
| 24 | BlockPreparatorMulticore::~BlockPreparatorMulticore() { |
| 25 | { |
| 26 | std::unique_lock<std::mutex> lock(mu); |
nothing calls this directly
no outgoing calls
no test coverage detected