diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2024-01-11 17:38:09 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2024-01-11 17:38:09 +0100 |
commit | dc79e956b628bb71a3ecbfdab6edd19ce6cf918f (patch) | |
tree | d1770397e511ed3f230e03d983bc4c3c7cb1e36c /main/main.cpp | |
parent | 9e967ebdf90e32fb93a7895a19a4111e72d9c660 (diff) | |
parent | a7317748135e064ff150072f2f46ccc1d2c4b358 (diff) | |
download | redot-engine-dc79e956b628bb71a3ecbfdab6edd19ce6cf918f.tar.gz |
Merge pull request #86587 from RandomShaper/wtp_enhance
Enhance & fix `WorkerThreadPool`
Diffstat (limited to 'main/main.cpp')
-rw-r--r-- | main/main.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/main/main.cpp b/main/main.cpp index 4dcd92bcff..b50def9cec 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -1615,16 +1615,12 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph } // Initialize WorkerThreadPool. - { + if (editor || project_manager) { + WorkerThreadPool::get_singleton()->init(-1, 0.75); + } else { int worker_threads = GLOBAL_GET("threading/worker_pool/max_threads"); - bool low_priority_use_system_threads = GLOBAL_GET("threading/worker_pool/use_system_threads_for_low_priority_tasks"); - float low_property_ratio = GLOBAL_GET("threading/worker_pool/low_priority_thread_ratio"); - - if (editor || project_manager) { - WorkerThreadPool::get_singleton()->init(); - } else { - WorkerThreadPool::get_singleton()->init(worker_threads, low_priority_use_system_threads, low_property_ratio); - } + float low_priority_ratio = GLOBAL_GET("threading/worker_pool/low_priority_thread_ratio"); + WorkerThreadPool::get_singleton()->init(worker_threads, low_priority_ratio); } #ifdef TOOLS_ENABLED |