252 EMBEDDED SYSTEMS
In the OS, interrupts are used either with hardware support (provided by the
processor) or by pure software. Either way, an interrupt handler or ISR does the
processing of the task initiated by the interrupt. In multitasking systems, task switching
is usually accomplished by interrupts. For example, in the round robin method, every
tseconds, an interrupt is generated and then the current task is pre-empted and the next
task is taken up.
Interrupts are associated with a delay which is called ‘interrupt latency’. Recollect
the sequence of actions that follow an interrupt, which are as follows:
i) Saving the current context
ii) Determining the identity of the interrupt
iii) Switching to the new context
iv) Starting ...