- August 29, 2009
- 1,730
- 1,124
- Home Country
-
Netherlands
See bug report here. It boils down to a loop that fires each second in the PowerScheduler, which causes a unnecessary burden on the CPU. See this post for a patch (copied below); I can push a Git branch or create a pull request too if wanted.
Code:
commit a9e50a7afe3d40fa2670c316d339ad5fd4f4a2de
Author: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>
Date: Tue Jan 3 23:10:30 2012
PowerScheduler: Do not poll at one second intervals
This is a totally unnecessary load on the system
diff --git a/TvEngine3/TVLibrary/Plugins/PowerScheduler/PowerScheduler.cs b/TvEngine3/TVLibrary/Plugins/PowerScheduler/PowerScheduler.cs
index 365337a..0fd79e5 100644
--- a/TvEngine3/TVLibrary/Plugins/PowerScheduler/PowerScheduler.cs
+++ b/TvEngine3/TVLibrary/Plugins/PowerScheduler/PowerScheduler.cs
@@ -825,32 +825,29 @@ namespace TvEngine.PowerScheduler
Log.Error("Powerscheduler: Error naming thread - {0}", ex.Message);
}
- int reload = 0;
+ LogVerbose("Looping in intervals of {0} seconds", PowerSettings.CheckInterval);
+
do
{
if (!_standby)
{
try
{
- if (reload++ == _reloadInterval)
- {
- reload = 0;
- CheckForStandby(true);
- // Clear cache
- CacheManager.Clear();
- GC.Collect();
- LoadSettings();
- SendPowerSchedulerEvent(PowerSchedulerEventType.Elapsed);
- }
- else
- CheckForStandby(false);
+ CheckForStandby(true);
+
+ // Clear cache
+ CacheManager.Clear();
+ GC.Collect();
+ LoadSettings();
+
+ SendPowerSchedulerEvent(PowerSchedulerEventType.Elapsed);
}
catch (Exception ex)
{
Log.Write(ex);
}
}
- if (_stopThread.WaitOne(1000)) // Wait one sec / exit
+ if (_stopThread.WaitOne(PowerSettings.CheckInterval * 1000)) // Wait one sec / exit
{
LogVerbose("Powerscheduler poll thread - exit");
return;
Last edited by a moderator: