Interrupts
Suppose that we have a program with one or more threads. The scheduler is queuing up threads from processes and switching contexts, as needed. Suppose that an external input to the processor changes state. The program needs to respond to this changed state in a timely manner. One method would be to frequently check ("poll") the input's status. In some cases, this is an adequate solution, but it can lead to missed events and uses excessive resources by continuous checking.
Fundamentally, the trouble is that we do not know in advance when these events will occur. It would be preferable for some device other than the processor to monitor an input channel for an important event and report when it occurs, so the processor can occasionally check the device for that signal and respond accordingly. This is in …
This is a preview. Read the full book in print or ebook — get it from MIT Press (ISBN 9780262548762).
Instructor with access? Instructor login.