SL-18190 Limit the number of decode threads.
parent
6a63c546ec
commit
80127acfa8
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue