diff options
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llappviewer.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index e874cf02cb..8e5a796498 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -2190,6 +2190,19 @@ bool LLAppViewer::initThreads() LLLFSThread::initClass(enable_threads && true); // TODO: fix crashes associated with this shutdo + //auto configure thread count + LLSD threadCounts = gSavedSettings.getLLSD("ThreadPoolSizes"); + + // get the number of concurrent threads that can run + S32 cores = std::thread::hardware_concurrency(); + + // The only configurable thread count right now is ImageDecode + // The viewer typically starts around 8 threads not including image decode, + // so try to leave at least one core free + S32 image_decode_count = llclamp(cores - 9, 1, 8); + threadCounts["ImageDecode"] = image_decode_count; + gSavedSettings.setLLSD("ThreadPoolSizes", threadCounts); + // Image decoding LLAppViewer::sImageDecodeThread = new LLImageDecodeThread(enable_threads && true); LLAppViewer::sTextureCache = new LLTextureCache(enable_threads && true); |