general: use IdlePriority rather than LowPriority
Fixes a number of playback stuttering and general UI lag issues by setting all background tasks to IdlePriority rather than LowPriority. While it was assumed LowPriority tasks would always get scheduled below NormalPriority (e.g. main thread) tasks, it turns out this is not always the case. If the background tasks start consuming a lot of CPU cycles, the scheduler may use "dynamic scheduling" to schedule them above the main thread regardless leading to UI lag. This is apparently the case for all thread priorities apart from IdlePriority, which is allegedly a special case where threads are *only* scheduled when other threads aren't busy ensuring the main thread stays responsive.
This commit is contained in:
@@ -34,7 +34,7 @@ void TaskDialog::open()
|
||||
}
|
||||
|
||||
// Create a separate thread to run this task in
|
||||
thread_->start(QThread::LowPriority);
|
||||
thread_->start();
|
||||
|
||||
// Move the task to this thread
|
||||
task_->moveToThread(thread_);
|
||||
|
||||
Reference in New Issue
Block a user