- #1
whitehorsey
- 192
- 0
1. Why is polling synchronous and interrupts are not?
Wiki articles:whitehorsey said:Then, it asks which one is synchronous polling or interrupts. I found that polling is synchronous but I don't understand why.
rcgldr said:
This is how the wiki article defines synchronous I/O, the program starts an I/O, then waits for that I/O to complete before continuing to do anything else.whitehorsey said:I'm thinking that polling is synchronous because you wait for it to be completed ...
rcgldr said:This is how the wiki article defines synchronous I/O, the program starts an I/O, then waits for that I/O to complete before continuing to do anything else.
...
Polling I/O is a method where the system continuously checks for new input or output data from a device. Interrupt, on the other hand, is a signal sent by a device to the processor to indicate that it needs attention.
Interrupt is generally more efficient as it allows the processor to perform other tasks while waiting for a device to send a signal. Polling I/O, on the other hand, requires the processor to constantly check for new data, which can waste computing resources.
Polling I/O allows for more control over the data transfer process and can potentially result in less data loss. It also allows for simpler coding and easier error handling.
Interrupt should be used in situations where time-sensitive tasks need to be performed quickly. For example, in real-time systems where immediate response to external events is crucial.
Yes, they can be used together in a hybrid approach. For example, a system can use interrupt to handle time-sensitive tasks and use polling I/O for less critical tasks. This can result in a more efficient and balanced system.