Interrupt Module
Role in the System
This module, which can be considered as one of the most central, implements a hardware level interrupt mechanism. The relevant NACHOS files are interrupt.h and interrupt.cc. An important question that arises is how can an interrupt be signalled when there is only one CPU in the computer. The answer is that in NACHOS, interrupts are checked for (in the interrupt queue) after each tick of the system clock. Time advances in one of three ways:
- interrupts are re-enabled in the code
- a user instruction is executed
- the ready queue is empty (ready queue is elaborated upon in the Thread Synchronization Module)
The purpose of the class "PendingInterrupt" is to instantiate in the system an interrupt object which is placed on the interrupt queue; to be processed at a specified time in the future. If the time in the clock is equal to the scheduled time in the interrupt, the interrupt is processed.
Uses Relation