Cognitive Scaffold

Preparing your thinking workspace

arrow_back_ios_new
MENTAL MODEL · M6221

Polling

Polling
TechnicalHigh supportComputer Science
Included
account_tree

Updated 2026-08-05

Loading revision record…

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.

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/1

Practice this model in one real situation:

Check to track your progress (stored locally)
Learning progress0%

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.

  • link
    zh.wikipedia.orghttps://zh.wikipedia.org/wiki/%E8%BC%AA%E8%A9%A2ZH · Explicit
    verified
account_treeGenealogyexpand_more

RELATED MODELS