From e2bb59a3e3c0d901c42c52eefe86465650639e8c Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Mon, 28 Oct 2019 17:24:21 -0600 Subject: [PATCH] limit waveview render threads to 8 --- libs/waveview/wave_view_private.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/libs/waveview/wave_view_private.cc b/libs/waveview/wave_view_private.cc index e8ffbd6819..74e7dc97f6 100644 --- a/libs/waveview/wave_view_private.cc +++ b/libs/waveview/wave_view_private.cc @@ -379,9 +379,14 @@ WaveViewThreads::start_threads () { assert (!_threads.size()); - int num_cpus = hardware_concurrency (); + const int num_cpus = hardware_concurrency (); - uint32_t num_threads = std::max (1, num_cpus - 1); + /* the upper limit of 8 here is entirely arbitrary. It just doesn't + * seem worthwhile having "ncpus" of low priority threads for + * rendering waveforms into the cache. + */ + + uint32_t num_threads = std::min (8, std::max (1, num_cpus - 1)); for (uint32_t i = 0; i != num_threads; ++i) { boost::shared_ptr new_thread (new WaveViewDrawingThread ());