In addition to these accounting timers, Linux supports process specific interval timers.
A process can use these timers to send itself various signals each time that they expire. Three sorts of interval timers are supported:
- the timer ticks in real time, and when the timer has expired, the process is sent a SIGALRM signal.
- This timer only ticks when the process is running and when it expires it sends a SIGVTALRM signal.
- This timer ticks both when the process is running and when the system is executing on behalf of the process itself. SIGPROF is signalled when it expires.
One or all of the interval timers may be running and Linux keeps all of the neccessary information in the process’s task_struct data structure. System calls can be made to set up these interval timers and to start them, stop them and read their current values. The virtual and profile timers are handled the same way.
Every clock tick the current process’s interval timers are decremented and, if they have expired, the appropriate signal is sent.
Real time interval timers are a little different and for these Linux uses the timer
This generates the SIGALRM signal and restarts the interval timer, adding it
back into the system timer queue.
This generates the SIGALRM signal and restarts the interval timer, adding it back into the system timer queue.