13
0

limit waveview render threads to 8

This commit is contained in:
Paul Davis 2019-10-28 17:24:21 -06:00
parent 7d3c2a4fee
commit e2bb59a3e3

View File

@ -379,9 +379,14 @@ WaveViewThreads::start_threads ()
{ {
assert (!_threads.size()); 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) { for (uint32_t i = 0; i != num_threads; ++i) {
boost::shared_ptr<WaveViewDrawingThread> new_thread (new WaveViewDrawingThread ()); boost::shared_ptr<WaveViewDrawingThread> new_thread (new WaveViewDrawingThread ());