From 712cdfbaa2478808b417dadcd0090eaf04911be0 Mon Sep 17 00:00:00 2001 From: tripp <86533397+trippjoe@users.noreply.github.com> Date: Sat, 19 Sep 2026 19:37:05 -0400 Subject: [PATCH] decompiler: limit level extraction workers to hardware concurrency (#4417) fixes an issue from my previous pull request #4278. this change restores the previous behavior prior and prevents the level extraction process from creating too many threads, ultimately resulting in the decompiler failing. --- common/util/SimpleThreadGroup.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/common/util/SimpleThreadGroup.cpp b/common/util/SimpleThreadGroup.cpp index aea1917a4d..a7e4c750c8 100644 --- a/common/util/SimpleThreadGroup.cpp +++ b/common/util/SimpleThreadGroup.cpp @@ -13,6 +13,8 @@ void SimpleThreadGroup::run(const std::function& func, int num_runs, // copy the function, in case the user gives us a temporary function. m_func = func; + num_workers = std::min(num_workers, std::thread::hardware_concurrency()); + int start_idx = 0; for (int thread_idx = 0; thread_idx < num_workers; thread_idx++) { int end_idx = ((thread_idx + 1) * num_runs) / num_workers;