Main, OutputThread: increase kernel timer slack (Linux)

Allows the kernel to combine timer wakeups with other processes,
reducing power usage.
This commit is contained in:
Max Kellermann
2014-01-30 18:37:30 +01:00
parent 39a2867ea8
commit a31738f6f1
5 changed files with 64 additions and 0 deletions

View File

@@ -60,6 +60,7 @@
#include "util/Error.hxx"
#include "util/Domain.hxx"
#include "thread/Id.hxx"
#include "thread/Slack.hxx"
#include "config/ConfigGlobal.hxx"
#include "config/ConfigData.hxx"
#include "config/ConfigDefaults.hxx"
@@ -523,6 +524,10 @@ int mpd_main(int argc, char *argv[])
win32_app_started();
#endif
/* the MPD frontend does not care about timer slack; set it to
a huge value to allow the kernel to reduce CPU wakeups */
SetThreadTimerSlackMS(100);
/* run the main loop */
main_loop->Run();