views:

20

answers:

1

Normally, a computer system only has a timer(hardware), and it trigger the system bu interrupts. But on application layer, we can set multiple tasks based on timer, like cron jobs. I am just wondering how system utilize the timer(hardware) to implement the application tasks(cron jobs, or java scheduled tasks).

Thanks

+1  A: 

Single timer, set to go off when the next task is up. Then it's set for the task after that, and so on, and so on.

In most cases, it's not even a timer hooked up to an interrupt, but a thread polling with Sleep delays.

Steven Sudit