feat: increased thread count for pool

This commit is contained in:
Sara Gerretsen 2025-09-23 09:23:27 +02:00
parent f393775fc8
commit 03da0b18e0

View file

@ -4,7 +4,7 @@
namespace threading { namespace threading {
ThreadPool::ThreadPool() { ThreadPool::ThreadPool() {
size_t const thread_count{ std::max(std::thread::hardware_concurrency() / 2, 1u) }; size_t const thread_count{ std::max(std::thread::hardware_concurrency() - 1, 1u) };
this->threads.reserve(thread_count); this->threads.reserve(thread_count);
for (size_t i{ 0 }; i < thread_count; ++i) { for (size_t i{ 0 }; i < thread_count; ++i) {
this->threads.emplace_back(std::bind(&ThreadPool::ThreadFn, this)); this->threads.emplace_back(std::bind(&ThreadPool::ThreadFn, this));