From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,d0077c2a3f44fc09 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit From: Brian May Newsgroups: comp.lang.ada Subject: Re: Port LPT + ADA (whta do I wrong?) References: <1gr5159dmj2vk.5tkxiw6kxrmv.dlg@40tude.net> <1olbt9ia2fuuo$.qbyglb1cl3g8.dlg@40tude.net> Date: Mon, 13 Dec 2004 09:46:10 +1100 Message-ID: User-Agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.3 (gnu/linux) Cancel-Lock: sha1:jMrPoFy4Uy5jyT3AUcKx/x1Hs8U= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii NNTP-Posting-Host: snoopy.microcomaustralia.com.au X-Trace: news.melbourne.pipenetworks.com 1102891545 202.173.153.89 (13 Dec 2004 08:45:45 +1000) X-Complaints-To: abuse@pipenetworks.com X-Abuse-Info: Please forward all headers to enable your complaint to be properly processed. Path: g2news1.google.com!news3.google.com!news.glorb.com!newsfeed-east.nntpserver.com!nntpserver.com!news1.optus.net.au!optus!news.mel.connect.com.au!news-north.connect.com.au!duster.adelaide.on.net!news.melbourne.pipenetworks.com!not-for-mail Xref: g2news1.google.com comp.lang.ada:6911 Date: 2004-12-13T09:46:10+11:00 List-Id: >>>>> "Steve" == Steve 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