← Back to context

Comment by shawn_w

2 days ago

Isn't a "centralized task scheduler" pretty much what cron is?

It’s not even a centralized task scheduler on its native UNIX: iI’s a centralized *userspace* task scheduler.

Mainframe and minicomputer operating systems support scheduling in the operating system itself, as part of their process/thread scheduler; their native queuing systems are built on top of the primitives their scheduler offers, for proper accounting and maximum resource utilization (including prioritization).

Only UNIX would just provide a way to run processes at a specified time or interval and call the job done.

I was going to guess the author needed something that unified the task scheduling across a distributed system of computers. But that requirement is never mentioned in the article. And they still use cron to call their new scheduler... So unless I am missing something they did not replace cron al all, they just rewrote their scheduled jobs to use a common library and have more robust error handling.

It's lacking a convenient way to queue a task and inspect the task queue, but "at" (at/atq/atrm) provides exactly the "single cron job responsible for executing scheduled tasks that runs once every minute" that the author was looking for.