set AIR cache thread priority

This commit is contained in:
Samuliak 2025-01-17 14:51:54 +01:00
parent 2a218d418f
commit 6cf7f437a7
No known key found for this signature in database

View file

@ -36,6 +36,17 @@ public:
// Create AIR cache thread
s_airCacheThread = new std::thread(&ShaderMtlThreadPool::AIRCacheThreadFunc, this);
// Set priority
sched_param schedParam;
schedParam.sched_priority = 20;
if (pthread_setschedparam(s_airCacheThread->native_handle(), SCHED_FIFO, &schedParam) != 0) {
cemuLog_log(LogType::Force, "failed to set FIFO thread priority");
}
if (pthread_setschedparam(s_airCacheThread->native_handle(), SCHED_RR, &schedParam) != 0) {
cemuLog_log(LogType::Force, "failed to set RR thread priority");
}
}
void StopThreads()
@ -48,9 +59,13 @@ public:
it.join();
s_threads.clear();
if (s_airCacheThread)
{
s_airCacheQueueCount.increment();
s_airCacheThread->join();
delete s_airCacheThread;
}
}
~ShaderMtlThreadPool()
{