In [digital computers]
? it is necessary to trigger software routines in response to asynchronous
? events directly rather than by software status inspection. Such a system uses an interrupt mechanism to
context switch the processor into a specifically written piece of software (interrupt routine). Typical examples of interrupts are a [clock signal]
?, a [disk interrupt]
? and a [power off interrupt]
?. The Clock interrupt's basic function was to keep time but it is also used to rechedule the priorities of running process
?es. A disk interrupt could signal the completion of a disk transfer and a power off interrupt could identify imminent loss of power allowing for a measure of ordered shutdown.
Interrupt routines generaly have a short execution time as it is unusual for an interrupt routine to allow itself to be interrupted. It also needs to be able to respond to a further interrupt from the same source.
Processors also often have a mechanism referred to as [Interrupt Lockout]? which allows a software process to prevent interruption for a short period. This mechanism can be used to gain absolute control over a resource of the computer for a necessary activity.