Interrupt is a hardware mechanism in which, the device notices the CPU that it requires its attention. Interrupt can take place at any time. So when CPU gets an interrupt signal trough the indication interrupt-request line, CPU stops the current process and respond to the interrupt by passing the control to interrupt handler which services device.
In polling is not a hardware mechanism, its a protocol in which CPU steadily checks whether the device needs attention. Wherever 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 dead by hardware or not. If command bit is ready one, then it’s some command to be dead else if the bit is zero, then it’s no commands.
Let’s see that the difference between interrupt and polling:
|1.||In interrupt, the device notices the CPU that it requires its attention.||Whereas, in polling, CPU steadily checks whether the device needs attention.|
|2.||An interrupt is not a protocol, its a hardware mechanism.||Whereas it isn’t a hardware mechanism, its a protocol.|
|3.||In interrupt, the device is serviced by interrupt handler.||While in polling, the device is serviced by CPU.|
|4.||Interrupt can take place at any time.||Whereas CPU steadily ballots the device at regular or proper interval.|
|5.||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.|
|6.||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.|
Attention reader! Don’t stop learning now. Get hold of all the important CS Theory concepts for SDE interviews with the CS Theory Course at a student-friendly price and become industry ready.
- Difference between Hardware Interrupt and Software Interrupt
- Difference between Programmed and Interrupt Initiated I/O
- Purpose of an Interrupt in Computer Organization
- Difference between User Level thread and Kernel Level thread
- Difference between Priority Inversion and Priority Inheritance
- Difference between 32-bit and 64-bit operating systems
- Difference between Multiprogramming, multitasking, multithreading and multiprocessing
- Difference between Volatile Memory and Non-Volatile Memory
- Difference between DOS and Windows
- Difference between Preemptive Priority based and Non-preemptive Priority based CPU scheduling algorithms
- Difference between dispatcher and scheduler
- Difference between Spooling and Buffering
- Difference between RAM and ROM
- Difference between Traditional and Reactive Computer System
- Difference between CD and DVD
- Difference between Random Access Memory (RAM) and Hard Disk Drive (HDD)
- Difference between Deadlock and Starvation in OS
- Difference between Long-Term and Short-Term Scheduler
- Difference between Virtual memory and Cache memory
- Difference between Network OS and Distributed OS
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.