Make realtime scheduling less aggressive

On the Wine side. Instead of always having it enabled and disabling it
when it could potentially hurt (i.e. when handling GUI related things),
we'll now only enable it when it's potentially beneficial. This way we
don't have to constantly switch scheduling policies on the GUI thread.
This commit is contained in:
Robbert van der Helm
2021-06-01 16:21:38 +02:00
parent 5f4ffed90b
commit 712ef41a7f
8 changed files with 92 additions and 78 deletions
-11
View File
@@ -291,18 +291,7 @@ class MainContext {
}
if (predicate()) {
// NOTE: These periodic callbacks should not be able to
// interrupt other threads that are actively
// processing audio. For me personally having the GUI
// open makes absolutely zero difference on DSP usage
// (as it should), but for some others it does have an
// impact.
// TODO: Benchmark this further on a properly configured
// system, see if it does not increase average load
// because of the rapid scheduling switching.
set_realtime_priority(false);
handler();
set_realtime_priority(true);
}
async_handle_events(handler, predicate);