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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no 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!news3.google.com!news4.google.com!news.glorb.com!news2.euro.net!newsfeed.freenet.de!newsfeed.arcor.de!news.arcor.de!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Palatable Windows IO using Ada Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.14.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <1144369304.698267.277640@u72g2000cwu.googlegroups.com> Date: Fri, 7 Apr 2006 09:29:42 +0200 Message-ID: <15qxrbngb2kll.wkigwit0g1tn.dlg@40tude.net> NNTP-Posting-Date: 07 Apr 2006 09:29:36 MEST NNTP-Posting-Host: 11fd172e.newsread2.arcor-online.net X-Trace: DXC=>0686S8Uhh:c]9?QGJT=S2Q5U85hF6f;4jW\KbG]kaM8AV6U:Z=fE=?^?I>]aDN]g<[6LHn;2LCV>7enW;^6ZC`4IXm65S@:3>? X-Complaints-To: usenet-abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:3743 Date: 2006-04-07T09:29:36+02:00 List-Id: On 6 Apr 2006 17:21:44 -0700, Le wrote: > Wrappers we > have seen for the Win32 API simply export the ReadFile and ReadFileEx > which appear to be blocking by their very nature and demand that the > reader have apriori knowledge of the length of input expected at any > particular instance. which is true for all kinds of any I/O in any OS. You should know the size of the byte, block, record, line before you start to read it. Windows ReadFile isn't always blocking, it can be asynchronous, see "overlapping" I/O in MSDN description of ReadFile. > Of course one can deal with the varying length by doing all reads one > character at a time, but this is quite waseful in the face of Windows > already daunting CPU requirements. Windows does buffering in background, so it isn't that wasteful. The knowledge of how many items can be read at once depends solely on the application. As for serial I/O, there are further settings to keep in mind. See Windows API SetCommTimeouts. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de