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,9bdd666589befb0f X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!j33g2000cwa.googlegroups.com!not-for-mail From: "Le" Newsgroups: comp.lang.ada Subject: Re: Palatable Windows IO using Ada Date: 7 Apr 2006 09:30:23 -0700 Organization: http://groups.google.com Message-ID: <1144427423.152451.170970@j33g2000cwa.googlegroups.com> References: <1144369304.698267.277640@u72g2000cwu.googlegroups.com> <15qxrbngb2kll.wkigwit0g1tn.dlg@40tude.net> NNTP-Posting-Host: 128.115.35.70 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1144427428 27312 127.0.0.1 (7 Apr 2006 16:30:28 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 7 Apr 2006 16:30:28 +0000 (UTC) In-Reply-To: <15qxrbngb2kll.wkigwit0g1tn.dlg@40tude.net> User-Agent: G2/0.2 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: j33g2000cwa.googlegroups.com; posting-host=128.115.35.70; posting-account=KkHgpQ0AAACJ6vo83UckeWojsCAJd4eu Xref: g2news1.google.com comp.lang.ada:3750 Date: 2006-04-07T09:30:23-07:00 List-Id: Your attempt at a tutorial is in error in a couple of places. Stating that an application "should know" what will be returned is presumptuous. Note this is a legacy application, so obviously there are some devices out there which give varying responses. These are raw byte sequences - no blocks or lines. Those esternal device ICDs are not typically in the control of a system designer. The ReadFile interface *is* blocking. Overlap allows an app to come back and see if it is done. If not, assuming timeout wasn't used, one must then cancel the IO or some other cleanup. With respect to buffering, my point was that doing byte at a time IO to get around the blocking nature of the API defeats the efficiencies presumably provided by the driver's internal buffering.