Open In App

Difference between Interrupt and Polling

Last Updated : 12 Jul, 2025
Comments
Improve
Suggest changes
Like Article
Like
Report

As modern computer systems grow increasingly complex, efficient communication between the CPU and peripheral devices becomes more critical. Devices like keyboards, mouse, printers, and network interfaces require timely interaction with the CPU to ensure smooth operation and user experience. Interrupts and polling represent two fundamental strategies for handling these interactions.

What is Interrupt?

Interrupt is a hardware mechanism in which, the device notices the CPU that it requires its attention. Interruptions can take place at any time. So when the CPU gets an interrupt signal through the indication interrupt-request line, the CPU stops the current process and responds to the interrupt by passing the control to the interrupt handler which services the device. 

Advantages

Disadvantages

  • Context Switching
  • Interrupt Latency

What is Polling?

Polling is not a hardware mechanism, its a protocol in which CPU steadily checks whether the device needs attention. Whenever device tells process unit that it desires hardware processing, in polling process unit keeps asking the I/O device whether or not it desires CPU processing. The CPU ceaselessly check every and each device hooked up thereto for sleuthing whether or not any device desires hardware attention. Each device features a command-ready bit that indicates the standing of that device, i.e., whether or not it's some command to be read by hardware or not. If command bit is ready one, then it's some command to be read else if the bit is zero, then it's no commands.

Advantages

Disadvantages

  • Inefficiency
  • Increased Power Consumption

Difference Between Interrupt and Polling

InterruptPolling
In interrupt, the device notices the CPU that it requires its attention.Whereas, in polling, CPU steadily checks whether the device needs attention.
An interrupt is not a protocol, its a hardware mechanism.Whereas it isn't a hardware mechanism, its a protocol.
In interrupt, the device is serviced by interrupt handler.While in polling, the device is serviced by CPU.
Interrupt can take place at any time.Whereas CPU steadily ballots the device at regular or proper interval.
In interrupt, interrupt request line is used as indication for indicating that device requires servicing.While in polling, Command ready bit is used as indication for indicating that device requires servicing.
In interrupts, processor is simply disturbed once any device interrupts it.On the opposite hand, in polling, processor waste countless processor cycles by repeatedly checking the command-ready little bit of each device.

Conclusion

Interrupts provide a more efficient and responsive method by allowing the CPU to perform tasks without constant monitoring, while polling, though simpler, can result in unnecessary CPU cycles being consumed. The choice between these mechanisms depends on the specific requirements of the system, such as the need for real-time processing, resource availability, and the complexity of the hardware.


Similar Reads