diff --git a/utilities/workerpool.cpp b/utilities/workerpool.cpp index 3f0d236e2..237c2fcaf 100644 --- a/utilities/workerpool.cpp +++ b/utilities/workerpool.cpp @@ -34,7 +34,10 @@ std::size_t worker_pool::capacity() { return 1; } - return std::max(1, std::thread::hardware_concurrency()); + // read once: the count asks the system for the processors of the machine (GetLogicalProcessorInformationEx on Windows), + // and the pool is asked for it by every job, several times a frame + static std::size_t const cores{std::max(1, std::thread::hardware_concurrency())}; + return cores; } void worker_pool::grow(std::size_t const Workers)