Interrupt vs Polling: Differences and When to Use Each
Updated: November 11, 2026
There are two ways for a processor to learn that a device needs attention. With polling, the CPU keeps checking the device status in a loop. With interrupts, the device signals the CPU, which pauses what it is doing, runs a small handler and then resumes. Polling is simple and predictable but wastes time; interrupts are efficient and responsive but add overhead and make the program harder to reason about.
Aspect
Polling
Interrupt
How it works
The CPU repeatedly reads a status register to see whether the device is ready
The device raises a signal; the CPU suspends its work and runs an interrupt handler (ISR)
CPU use while waiting
Busy: the CPU spends cycles checking
Free: the CPU can do other work or sleep
Response time
Set by how often the loop checks; predictable
Fast (microseconds), but varies with masking, priority and context saving
Overhead
Constant, even when nothing happens
A cost per event; a very high event rate can overwhelm the CPU (interrupt storm)
Complexity
Simple to write and debug
More complex: handlers must be short, and shared data with the main code needs care (volatile, atomic access)
Power
Keeps the CPU awake
Allows low-power sleep until an event wakes the CPU
Timing behavior
Easy to reason about
Concurrency bugs are possible between handler and main code
Typical uses
Very fast or continuous events, simple programs, high-speed networking drivers
Timers, buttons, communication events, sensor alerts, waking from sleep
Figures are typical orders of magnitude and vary by process generation and product.
When to use which
Polling
When events are frequent or the loop is simple, and you want predictable timing without handler complexity.
Interrupt
When events are rare or unpredictable, you want a quick response and low power, and the CPU has other work to do.
Hybrid
Some systems combine them: an interrupt announces the first event, and the driver then polls while traffic is heavy, as in high-speed network drivers.
FAQ
Which is better, interrupts or polling?
Neither always. Interrupts give a fast response and let the CPU sleep, while polling is simple and predictable. Use interrupts for rare events and polling for very frequent ones.
What should an interrupt handler do?
Be short: do the minimum, set a flag or queue the work, and return. Long work or blocking calls inside a handler hurt responsiveness.
What is an interrupt storm?
When events arrive so fast that the CPU spends all its time entering and leaving handlers. High-speed network drivers switch to polling in that case.
Why do interrupts save power?
The CPU can sleep until an event wakes it, instead of waking up constantly to check.
AWith polling the CPU checks the status repeatedly; with interrupts the peripheral notifies the CPU when the status changes
BPolling and interrupts are the same thing
CInterrupts are the method where the CPU repeatedly checks the status
Show answer and explanation
Answer: A. With polling the CPU checks the status repeatedly; with interrupts the peripheral notifies the CPU when the status changes
Polling is simple and predictable because checks happen at fixed intervals, but the CPU keeps checking even when nothing happens, wasting time and power. With interrupts the CPU responds only when something changes, so it can do other work or sleep while waiting. If interrupts are extremely frequent, though, their overhead becomes large, so the choice matters.
AWriting 1 to a flag variable to notify the main code
BClearing the bit that indicates the interrupt source
CTime-consuming work such as printing long strings with printf or loops that wait for something to happen
Show answer and explanation
Answer: C. Time-consuming work such as printing long strings with printf or loops that wait for something to happen
While an interrupt handler runs long, other interrupts cannot be serviced and the main code stalls. printf takes time to finish and may itself rely on interrupts, so it is especially risky. A handler should do only the minimum, such as moving received data into a buffer or setting a flag, and leave heavy work to the main loop or a task. It must also remember to clear the interrupt source bit.
AThe low-priority handler is suspended, the high-priority handler runs, and then the low one resumes
BThe high-priority interrupt is discarded until the low handler finishes
CBoth handlers execute in parallel on the same CPU at once
Show answer and explanation
Answer: A. The low-priority handler is suspended, the high-priority handler runs, and then the low one resumes
With interrupt priorities, an urgent interrupt is serviced even while another handler is running. For example, if motor overcurrent detection has high priority and communication reception low priority, overcurrent can be handled at once even mid-reception. Arm Cortex-M's NVIC and others provide this mechanism. Interrupts of equal or lower priority wait until the current handler finishes.
A CPU mechanism that temporarily suspends the current task to handle a request, for example from an external device, and then returns to the original task.
This page was drafted with AI and fact-checked by a separate AI review before publication. Our Editorial policy explains how we write and check content. If you spot an error, please tell us on our Contact page.