tickless cron

Rogelio Serrano rogelio.serrano at gmail.com
Sun Sep 3 01:23:19 UTC 2006


On 9/3/06, Mark Richards <mark.richards at massmicro.com> wrote:


>
> The original design of cron, I guess, was to parse the event list every
> 60 seconds this list could change since the last time it was parsed.
> But I am blabbing mostly as a technoid user who has tinkered with the
> cron code a bit for other purposes (and subsequently broke it!).  Maybe
> there are other considerations here?
>
> Rob suggested a method that won't modify existing code which you don't
> like.  Why?

ok i think i will give it a shot. im not using a separate cron server.
i added the capability to init.

im just trying to see if it makes sense to have cron compatibility in
this scenario. what i have right now is just an list of exact hour
minute timeouts plus a repetition period. thats the simplest  scheme i
can wrap my brain around.

>
> I suppose a modification might be to pass a parameter to the daemon
> telling it to parse the list once, then get the event time for the next
> event, sleep until the event time is reached, then launch the process,
> and then parse the list again... looping back.  This would avoid having
> to wake up and parse the event list unnecessarily.  It's not clear to me
> why cron needs to loop through an advancing unixtime value and re-parse
> the list in order to determine the next event time.  It should be
> possible to extrapolate the next event time from the list entry, no?
>

yes. a priority queue. when the topmost item expires recompute the
next event then reinsert item in the queue and then program a one shot
timer with the topmost item. this is what the tickless kernel does.

> This would actually be useful to me because there's no need for cron to
> check for a list event update unless I tell it to, although my embedded
> box isn't otherwise idle, but every mips helps.
>
> I wonder if this would do what you want?

yes. its because i have a tickless kernel and it does not make sense
to reimpose ticks on the kernel from userspace after working so hard
to make the kernel tickless in the first place.

-- 
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