From a0ad3b992123494e99a9d455a52b84fc0536a2a9 Mon Sep 17 00:00:00 2001 From: Paul Ferrand Date: Wed, 23 Sep 2020 12:00:11 +0200 Subject: [PATCH] Adapt the thread pool to the number of concurrent threads --- src/sfizz/FilePool.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sfizz/FilePool.cpp b/src/sfizz/FilePool.cpp index 543c9bf6..172b57c5 100644 --- a/src/sfizz/FilePool.cpp +++ b/src/sfizz/FilePool.cpp @@ -47,7 +47,7 @@ #endif #include "threadpool/ThreadPool.h" using namespace std::placeholders; -static ThreadPool threadPool { sfz::config::numBackgroundThreads }; +static ThreadPool threadPool { std::thread::hardware_concurrency() > 2 ? std::thread::hardware_concurrency() - 2 : 1 }; void readBaseFile(sfz::AudioReader& reader, sfz::FileAudioBuffer& output, uint32_t numFrames) {