From 513a658c87b5fa23533a6b6db36e6d36af6a861d Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Thu, 28 Apr 2016 20:25:33 +0100 Subject: add a --max-concurrency flag It sets the max number of threads to use for a parallel job. This is different that the number of total threads, since monero binaries typically start a lot of them. --- src/cryptonote_core/blockchain.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/cryptonote_core/blockchain.cpp') diff --git a/src/cryptonote_core/blockchain.cpp b/src/cryptonote_core/blockchain.cpp index 88ecb2dad..b4445756d 100644 --- a/src/cryptonote_core/blockchain.cpp +++ b/src/cryptonote_core/blockchain.cpp @@ -2124,7 +2124,7 @@ bool Blockchain::check_tx_inputs(const transaction& tx, tx_verification_context std::vector < uint64_t > results; results.resize(tx.vin.size(), 0); - int threads = boost::thread::hardware_concurrency(); + int threads = tools::get_max_concurrency(); boost::asio::io_service ioservice; boost::thread_group threadpool; @@ -3001,7 +3001,7 @@ bool Blockchain::prepare_handle_incoming_blocks(const std::list 1 && threads > 1 && m_max_prepare_blocks_threads > 1) { @@ -3200,7 +3200,7 @@ bool Blockchain::prepare_handle_incoming_blocks(const std::list> transactions(amounts.size()); - threads = boost::thread::hardware_concurrency(); + threads = tools::get_max_concurrency(); if (!m_db->can_thread_bulk_indices()) threads = 1; -- cgit v1.2.3