diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2019-10-28 17:24:21 -0600 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2019-10-28 17:24:21 -0600 |
commit | e2bb59a3e3c0d901c42c52eefe86465650639e8c (patch) | |
tree | 24340e39f6249619d7dc003a40474b5df74d64d0 /libs/waveview | |
parent | 7d3c2a4feee924ed4e12cd2048ae01a7db2e92a9 (diff) |
limit waveview render threads to 8
Diffstat (limited to 'libs/waveview')
-rw-r--r-- | libs/waveview/wave_view_private.cc | 9 |
1 files 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<WaveViewDrawingThread> new_thread (new WaveViewDrawingThread ()); |