From a31738f6f1473f4f621bc16513ed0c6024749389 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 30 Jan 2014 18:37:30 +0100 Subject: Main, OutputThread: increase kernel timer slack (Linux) Allows the kernel to combine timer wakeups with other processes, reducing power usage. --- src/Main.cxx | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/Main.cxx') diff --git a/src/Main.cxx b/src/Main.cxx index f8f7a6545..ab70c875c 100644 --- a/src/Main.cxx +++ b/src/Main.cxx @@ -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(); -- cgit v1.2.3