Alfred
Alfred

Reputation: 1851

system timer implementation

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

Upvotes: 0

Views: 322

Answers (1)

Steven Sudit
Steven Sudit

Reputation: 19640

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.

Upvotes: 1

Related Questions