[beast: 5/6] BSE: adjust number of slave DSP threads to the number of available CPU cores
- From: Tim Janik <timj src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [beast: 5/6] BSE: adjust number of slave DSP threads to the number of available CPU cores
- Date: Sun, 6 Nov 2016 22:32:52 +0000 (UTC)
commit c38f9d646e2453cf619122983f7aed3030ee6e1e
Author: Tim Janik <timj gnu org>
Date: Sun Nov 6 23:23:28 2016 +0100
BSE: adjust number of slave DSP threads to the number of available CPU cores
Signed-off-by: Tim Janik <timj gnu org>
bse/bseenginemaster.cc | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/bse/bseenginemaster.cc b/bse/bseenginemaster.cc
index 2ca4a85..768983b 100644
--- a/bse/bseenginemaster.cc
+++ b/bse/bseenginemaster.cc
@@ -908,8 +908,8 @@ engine_start_slaves ()
{
assert_return (slaves_running == false);
slaves_running = true;
- const uint n_cpus = 4; // FIXME: processors online?
- const uint n_slaves = n_cpus - 1;
+ const uint n_cpus = Rapicorn::ThisThread::online_cpus();
+ const uint n_slaves = std::max (1u, n_cpus) - 1;
for (uint i = 0; i < n_slaves; i++)
slave_threads.push_back (new std::thread (engine_run_slave));
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]