Interrupts, timers & polling
Notify the CPU about events, or repeatedly check for them.
A device can finish its work while the CPU is busy doing something else.
Device or timer event.
Follow an instruction
Overlap improves throughput. Dependencies introduce bubbles unless the implementation can forward or do independent work.
What this model includes
Five-stage, single-issue teaching model. Dependent mode inserts two idle issue cycles per instruction; real forwarding and hazards vary.
What happens inside
Deliver an event
An interrupt controller routes events to a processor. The CPU saves required state and runs a handler under architectural rules. PCIe devices often use message-signaled interrupts such as MSI/MSI-X. Timers trigger scheduling and timekeeping events. Exceptions arise from instruction execution and differ from asynchronous device interrupts.
Choose notification or polling
Interrupts avoid constant checking at low event rates. Frequent events can create overhead, so devices may batch notifications or an OS may poll temporarily. Polling can reduce wake-up latency at the cost of CPU time and energy. Deferred work keeps handlers short when the OS requires it.
What this means for your code
Low-level engineer
Know interrupt context, masking, acknowledgment, and reentrancy rules. Do not sleep where the kernel’s execution context forbids it.
Software developer
Latency can include wake-up and queueing, not just device time. Busy polling is a deliberate energy and CPU tradeoff.
Read the actual specifications
These references supply the underlying contracts and implementation details. The diagrams here are simplified teaching models.