I want to know how cron works internally. Does the process keep checking the current time in an infinite while loop (thus continually consuming CPU cycles)? Or does some function generate an interrupt and notifies the cron daemon ?
|
|
||||
|
|
|
I once read the vixie-cron source code and had to be hospitalized. However if you're looking for "some function generate an interrupt" at a time in the future, you should investigate the |
||||
|
|
|
I'm sure there are many variations, the way it works in dcron is that it sleeps for up to 60 seconds at a time, it tries to synchronise this by sleeping less if needed to wake up at 00 seconds. It uses I've never seen a crond that runs things more frequently than once per-minute, so it's usually quite light on resources. Under linux if you look in
(thanks to scheduled package updates, and ASLR/prelink tasks in this case) See also http://stackoverflow.com/questions/3982957/how-does-cron-internally-schedule-jobs . |
|||||||
|