Wiki article: Understanding Synchronous and Asynchronous I/O

  • Thread starter whitehorsey
  • Start date
In summary, polling is synchronous while interrupts are not. Polling occurs when the OS needs to know whether the I/O is done, while interrupts are handled when the OS needs to do something else.
  • #1
whitehorsey
192
0
1. Why is polling synchronous and interrupts are not?
 
Physics news on Phys.org
  • #2
What is the source of interrupts? What is determining when polling occurs?
 
  • #3
Is this a question about terminology (syncrhonous versus asyncrhonous) or about the differences / advantages of using interrupts instead of polling (in software)?
 
  • #4
Ah the question is related to how polling and interrupts are used by the OS to see when the I/O is finished. Then, it asks which one is synchronous polling or interrupts. I found that polling is synchronous but I don't understand why. =/
 
  • #6
  • #7
whitehorsey said:
I'm thinking that polling is synchronous because you wait for it to be completed ...
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.

However, even without using interrupts, the polling could be handled by calls to a function (one that polls for and handles I/O completion) interspersed within some code that peforms some other function while the I/O is ongoing. This would introduce a delay in the I/O completion response, but if the I/O hardware includes buffering, it wouldn't be an issue as long as the polling is done frequently enough. Based on the wiki terminology, this would be considered asynchronous, even though polling is involved.

A similar concept for a crude form of multi-tasking operating system, would be non-pre-emptive and co-operative multi-tasking. Wiki articles:

nonpreemptive_multitasking.htm

cooperative_multitasking.htm
 
Last edited:
  • #8
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.
...

I got it! Thank You!
 

FAQ: Wiki article: Understanding Synchronous and Asynchronous I/O

What is the difference between polling I/O and interrupt?

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.

Which is more efficient, polling I/O or interrupt?

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.

What are the advantages of using polling I/O?

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.

When should I use interrupt over polling I/O?

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.

Can polling I/O and interrupt be used together?

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.

Similar threads

Back
Top