Polling
Updated 2026-08-05
Summary
Polling is a technique in which the processor repeatedly checks a device's status register to see whether it has data, wasting cycles when nothing is ready.
Definition
In computing, polling is the practice of having the processor periodically read a device's status flag to determine whether it needs service. It is simple and predictable, and it suits small deterministic systems where the device is fast relative to the checking loop. Its cost is busy waiting: the processor spends cycles checking a device that usually has nothing to report, which is why interrupt-driven designs are preferred for slower or less predictable devices.
Introduction
How to use
- Check before asking: estimate how often the answer will be useful before polling again. - Use push instead: set up a signal that fires when something actually happens. - Respect the cost: count the cycles or attention your repeated checks consume.
Mechanism
Each poll spends a fixed amount of processor time to learn whether work exists. When the device is rarely ready, most of that time returns no information, so the cost scales with the polling frequency rather than with useful events. An interrupt inverts the relationship by having the device signal the processor, so cost tracks actual events instead of checks.
Practice
In progress 0/1Practice this model in one real situation:
Cases
- Microcontrollers commonly poll a button or sensor in a tight loop because the check is cheap and the timing predictable.
- Repeatedly asking a colleague whether they are free is polling; agreeing to be contacted when needed is an interrupt.
Common pitfalls
- Assuming polling is always simpler and more efficient than interrupts, when frequent polling wastes processor time.
- Busy waiting in a tight loop, which blocks the processor from doing other useful work.
Sources
Source support: Explicit
References currently contain only Wikipedia links; primary sources still need review.
- zh.wikipedia.orghttps://zh.wikipedia.org/wiki/%E8%BC%AA%E8%A9%A2verified
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