Adapt the thread pool to the number of concurrent threads

This commit is contained in:
Paul Ferrand 2020-09-23 12:00:11 +02:00
parent 1e2ae6bce7
commit a0ad3b9921

View file

@ -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)
{