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:
@@ -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();
|
||||
|
||||
|
Reference in New Issue
Block a user