tickless cron

Allan Clark allanc at chickenandporn.com
Fri Sep 1 06:12:08 UTC 2006


On 9/1/06, Rogelio Serrano <rogelio.serrano at gmail.com> wrote:
> On 9/1/06, Natanael Copa <natanael.copa at gmail.com> wrote:
> > On Fri, 2006-09-01 at 11:39 +0800, Rogelio Serrano wrote:
> > > is it possible to have tickless cron?
> >
> > Everything is possible. The impossible just take a little more time.
> >
> > > given a cron format schedule string can we compute the exact time of
> > > the next timeout?
> >
> > It is possible, but the question is if you want that. You would also
> > like to check if your crontab(s) has changed. But ofcourse, you could
> > use inotify for that.
> >
> > > the only algorithm i can come up with lists the exact day hour minute
> > > time and daily, weekly or monthly repetition specifier.
> >
>
> what i mean is not have cron set a timer to one minute and evaluating
> all the schedules once a minute. the present crontab format works well
> in that mode becaue its just a straight comparison with the present
> time and the values in a crontab line which can actually be placed in
> a 'struct time'. what i would like to have is for cron to set the
> timer exactly to the next timeout. i have a tickless kernel and it
> does not make sense for cron the do exactly what i just removed from
> the kernel.
>
> maybe the crontab compatible schedule just cannot be made to work in
> tickless mode.

This "tickless" mode is how the alarmclock tends to work in embedded
devices, such as linux handsets (mobile phones).

inotify seems to handle the crontab-changing notion, but might not
handle when new crontabs are added.  The cron docs say to always use
"crontab -e", which seems to be a good place to SIGHUP or SIGUSR the
cron daemon when changes have to be checked.  the crond would also
need a signal whenever the clock changed (so that "17:00 every sunday"
still means the same thing) -- that's actually a problem on some
Alarmclock and scheduler implementations.

Allan



More information about the busybox mailing list