interrupt handler
interrupt handler
[′int·ə‚rəpt ‚hand·lər]interrupt handler
(software)If interrupts are masked then the handler must execute asquickly as possible so that important events are not missed.This is often arranged by splitting the processing associatedwith the event into "upper" and "lower" halves. The lowerpart is the interrupt handler which masks out furtherinterrupts as required, checks that the appropriate event hasoccurred (this may be necessary if several events share thesame interrupt), services the interrupt, e.g. by reading acharacter from a UART and writing it to a queue, andre-enabling interrupts.
The upper half executes as part of a user process. It waitsuntil the interrupt handler has run. Normally the operating system is responsible for reactivating a process which iswaiting for some low-level event. It detects this by a sharedflag or by inspecting a shared queue or by some othersynchronisation mechanism. It is important that the upper andlower halves do not interfere if an interrupt occurs duringthe execution of upper half code. This is usually ensured bydisabling interrupts during critical sections of code suchas removing a character from a queue.