1
2.5kviews
What is the difference between the interrupt and polling?
written 5.8 years ago by | modified 2.3 years ago by |
discuss the parameters that distinguish between polling and interrupts..
ADD COMMENT
EDIT
1 Answer
written 5.8 years ago by | modified 2.3 years ago by |
discuss the parameters that distinguish between polling and interrupts..
written 2.3 years ago by |
Sr. No. | Parameters | Interrupt | Polling |
---|---|---|---|
1 | Mechanism | Interrupt is considered a hardware mechanism. | Pilling is a type of protocol. |
2 | Procedure | Device notifies CPU that it needs CPU attention. | CPU constantly checks device status whether it needs CPU's attention. |
3 | Service Provider | Interrupt handler services the Device. | CPU services the device. |
4 | Definition | An interrupt is an event that is triggered by external components other than the CPU that alerts the CPU to perform a certain action. | Polling is an asynchronous activity that samples the status of an external device by a client program. |
5 | Occurrences | Interrupt can occur at any time. | Polling occurs at regular intervals. |
6 | Indication | The interrupt-request line indicates that a device needs service. | The command-ready bit indicates the device needs service. |
7 | CPU Cycles | CPU is disturbed only when a device needs servicing, which saves CPU cycles. | CPU has to wait and check whether a device needs servicing which wastes lots of CPU cycles. |
8 | Efficiency | Interrupt becomes inefficient when devices keep on interrupting the CPU repeatedly. | Polling becomes inefficient when the CPU rarely finds a device ready for service. |
9 | Benefits | Serves multiple devices, flexible, and efficient. | Simple program, transmission reliability, and no need for additional chips. |
10 | Drawbacks | More complex and time-consuming. | Standby time and CPU cycle waste. |
11 | Example | Let the bell ring then open the door to check who has come. | Constantly keep on opening the door to check whether anybody has come. |