Cap the number of thread again (at a very high count)

This commit is contained in:
Henrik Rydgård committed 2026-11-07 12:05:12 +01:00
1 parent c77523b81e
commit 286debc3ba
1 file changed
+4 -4
+4 -4
View File
@@ -207,14 +207,14 @@ void ThreadManager::Init(int numRealCores, int numLogicalCoresPerCpu) {
Teardown();
}
numComputeThreads_ = numRealCores * numLogicalCoresPerCpu;
numComputeThreads_ = std::min(32, numRealCores * numLogicalCoresPerCpu);
// Double it for the IO blocking threads.
int numThreads = numComputeThreads_ + std::max(MIN_IO_BLOCKING_THREADS, numComputeThreads_);
numThreads_ = numThreads;
const int numIOThreads = std::min(32, std::max(MIN_IO_BLOCKING_THREADS, numComputeThreads_) * 2);
numThreads_ = numComputeThreads_ + numIOThreads;
INFO_LOG(Log::System, "ThreadManager::Init(compute threads: %d, all: %d)", numComputeThreads_, numThreads_);
for (int i = 0; i < numThreads; i++) {
for (int i = 0; i < numThreads_; i++) {
TaskThreadContext *thread = new TaskThreadContext();
thread->cancelled.store(false);
thread->type = i < numComputeThreads_ ? TaskType::CPU_COMPUTE : TaskType::IO_BLOCKING;