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.
This commit is contained in:
tripp
2026-09-19 19:37:05 -04:00
committed by GitHub
parent 31c3733673
commit 712cdfbaa2
+2
View File
@@ -13,6 +13,8 @@ void SimpleThreadGroup::run(const std::function<void(int)>& func, int num_runs,
// copy the function, in case the user gives us a temporary function.
m_func = func;
num_workers = std::min<int>(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;