mirror of
https://github.com/open-goal/jak-project
synced 2026-10-09 13:57:10 -04:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user