comp.lang.ada
 help / color / mirror / Atom feed
From: Brian May <bam@snoopy.apana.org.au>
Subject: Re: Port LPT + ADA (whta do I wrong?)
Date: Mon, 13 Dec 2004 09:46:10 +1100
Date: 2004-12-13T09:46:10+11:00	[thread overview]
Message-ID: <sa43bybqgnh.fsf@snoopy.apana.org.au> (raw)
In-Reply-To: VbKdnfKmSI1LHyvcRVn-2A@comcast.com

>>>>> "Steve" == Steve  <nospam_steved94@comcast.net> writes:

    Steve> Using overlapped I/O does NOT mean that ReadFile will not
    Steve> wait for any data before returning.  It does mean that if
    Steve> ReadFile returns FALSE, then you'll have to call
    Steve> "WinBase.GetLastError" to get the error code, and if the
    Steve> error code is "ERROR_IO_PENDING" than you'll have to read
    Steve> again.  In my serial driver I do exactly that.

Are you sure about this?

Looking at the documentation on Microsoft's website, I get the opinion:

overlapped IO == asynchronous IO

Some quotes at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/synchronization_and_overlapped_input_and_output.asp:

"[...] Functions called for overlapped operation can return
immediately, even though the operation has not been completed. [...]
For example, a single thread can perform simultaneous I/O operations
on different handles, or even simultaneous read and write operations
on the same handle."

"To synchronize its execution with the completion of the overlapped
operation, the calling thread uses the GetOverlappedResult function or
one of the wait functions to determine when the overlapped operation
has been completed. You can also use the HasOverlappedIoCompleted
macro to poll for completion."

It doesn't say anything about an ERROR_IO_PENDING or that you should
make the same IO call again.
-- 
Brian May <bam@snoopy.apana.org.au>



  parent reply	other threads:[~2004-12-12 22:46 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-03 13:56 Port LPT + ADA S�awo - MIR
2004-12-03 14:40 ` Martin Krischik
2004-12-03 15:29   ` Slawo - MIR
2004-12-03 18:46     ` Martin Krischik
2004-12-03 18:43 ` tmoran
     [not found] ` <u111r0db4fsoj9u3hlkachspjt0r2vvup7@4ax.com>
2004-12-03 23:03   ` Adrien Plisson
2004-12-03 23:51     ` Slawo - MIR
2004-12-04  0:51     ` Jeffrey Carter
2004-12-04 18:05 ` Port LPT + ADA (whta do I wrong?) S�awo - MIR
2004-12-04 20:20   ` Dmitry A. Kazakov
2004-12-07 18:13     ` Slawo - MIR
2004-12-07 20:55       ` Dmitry A. Kazakov
2004-12-08  4:28         ` Steve
2004-12-08  8:27           ` Dmitry A. Kazakov
2004-12-12 22:25           ` Brian May
2004-12-14  2:41             ` Steve
2004-12-12 22:46           ` Brian May [this message]
2004-12-12 23:03             ` Adrien Plisson
     [not found]       ` <rt8dr09tuvgbqaeq9vmujd1pqtb72hbamv@4ax.com>
2004-12-09  8:17         ` Jerry van Dijk
2004-12-05  6:45   ` Brian May
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox