1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Polling I/O vs Interrupt

  1. Jan 27, 2013 #1
    1. Why is polling synchronous and interrupts are not?
     
  2. jcsd
  3. Jan 27, 2013 #2

    lewando

    User Avatar
    Gold Member

    What is the source of interrupts? What is determining when polling occurs?
     
  4. Jan 27, 2013 #3

    rcgldr

    User Avatar
    Homework Helper

    Is this a question about terminology (syncrhonous versus asyncrhonous) or about the differences / advantages of using interrupts instead of polling (in software)?
     
  5. Jan 27, 2013 #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. Jan 27, 2013 #5

    rcgldr

    User Avatar
    Homework Helper

    Last edited: Jan 27, 2013
  7. Jan 28, 2013 #6
  8. Jan 28, 2013 #7

    rcgldr

    User Avatar
    Homework Helper

    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: Jan 28, 2013
  9. Jan 29, 2013 #8
    I got it! Thank You!
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Polling I/O vs Interrupt
  1. C++: File I/O (Replies: 1)

Loading...