Polling vs Interrupts
Updated 2026-07-31
Summary
Two ways for the CPU to handle external events: polling is the CPU asking 'anything happening?' every second (wasteful), while interrupts are external devices actively interrupting the CPU with 'I have something!' (efficient).
Definition
Two ways for the CPU to handle external events: polling is the CPU asking 'anything happening?' every second (wasteful); interrupts are when an external device actively interrupts the CPU with 'I have something!' (efficient). Scaffold use: attention protection. Don't check email every 5 minutes (polling). Turn off notifications, set specific times to process, or only allow extremely urgent events to trigger 'interrupts'. Switch from polling mode to interrupt mode.
Introduction
How to use
Attention protection. Don't check email every 5 minutes (polling). Turn off notifications, set specific times to process, or only allow extremely urgent events to trigger 'interrupts'. Switch from polling mode to interrupt mode.
Mechanism
Compare two I/O handling methods: polling is the CPU actively querying repeatedly, while interrupts are when a device event passively interrupts the CPU. The mechanism is that interrupts respond only when an event occurs, making them generally more efficient and timely.
Practice
In progress 0/2Practice this model in one real situation:
Cases
- Keyboards often use interrupts, ADC sampling can use polling; real-time systems often use interrupts plus buffering.
Common pitfalls
- Thinking interrupts are always better than polling (interrupts have latency, jitter, and stack overhead; in some hard real-time scenarios, polling is more predictable).
Sources
Source support: Explicit
- baike.baidu.comhttps://baike.baidu.com/view/2116365.htmverified
account_treeGenealogyexpand_more
PRIVATE NOTES · Only visible to you
SAVED Q&A
ENTRY Q&A · Private saving available
Ask with a clear boundary
thinkingmodels answers from published entry context only.
Your question is sent to thinkingmodels. The answer uses public entry context only.
RELATED MODELS