tickless cron

Rogelio Serrano rogelio.serrano at gmail.com
Tue Sep 5 17:20:54 UTC 2006


On 9/3/06, Rob Landley <rob at landley.net> wrote:

> The stupid way to do this with almost no changes to the existing code is with
> a for loop over the next 24 hours checking every 1 minute interval in the
> future via the existing logic until you get a hit.  This eats CPU to do the
> calculation, but 60*24 is only 1440 which isn't that bad, and it then lets
> you power down the processor for longer.  If you don't find an event within
> the next 24 hours, set 24 hours from now as the timeout point and try again
> when you wake up.  (This catches "every sunday" style events.  You still wake
> up once a day.  Big deal.)

it is not stupid after all. it can be done as a preprocesss step
instead. analyse the cron schedule string and generate a list or array
of timeout events for the particular period which can be easily
inferred from the schedule string. then all the server needs to to do
is walk through the structure. more space will be needed though but i
dont mind.

-- 
the thing i like with my linux pc is that i can sum up my complaints in 5 items



More information about the busybox mailing list