Topic 5 · Resource Management (HL)
Computer Science · Cheatsheet

Topic 5 · Resource Management (HL)

Chapter 3 · Polling vs interrupts

📋 Reference · always available
Polling
CPU repeatedly asks 'are you ready?'. Simple. Wastes cycles for sparse events.
Interrupt
Device signals CPU; CPU pauses, runs ISR, resumes. Efficient for sparse / unpredictable events.
ISR
Interrupt Service Routine — SHORT OS handler that acknowledges + moves data + wakes blocked process + returns.
IVT
Interrupt Vector Table — maps interrupt number to ISR address.
When to poll
Very high-rate predictable streams (10+ Gbps networking via NAPI). OR hardware with no interrupt support.
When to interrupt
Sparse + unpredictable (keyboard, mouse, disk-read complete, network packet arrival).
Top half / bottom half
Linux convention: ISR does minimum (top); awakened kernel thread does heavy work (bottom).
ISR rule
Keep SHORT. Long ISRs delay other interrupts, can cause drops + unresponsive system.