comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Palatable Windows IO using Ada
Date: Fri, 7 Apr 2006 09:29:42 +0200
Date: 2006-04-07T09:29:36+02:00	[thread overview]
Message-ID: <15qxrbngb2kll.wkigwit0g1tn.dlg@40tude.net> (raw)
In-Reply-To: 1144369304.698267.277640@u72g2000cwu.googlegroups.com

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



  reply	other threads:[~2006-04-07  7:29 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-07  0:21 Palatable Windows IO using Ada Le
2006-04-07  7:29 ` Dmitry A. Kazakov [this message]
2006-04-07 16:30   ` Le
2006-04-07 18:51     ` Dmitry A. Kazakov
2006-04-07 19:21       ` Le
2006-04-07 20:49         ` Dmitry A. Kazakov
2006-04-08  2:07   ` Steve
2006-04-08  9:36     ` Dmitry A. Kazakov
2006-04-09 13:50       ` Steve
2006-04-10  7:43         ` Dmitry A. Kazakov
2006-04-10 13:50           ` Steve
2006-04-10 15:05             ` Dmitry A. Kazakov
2006-04-10 19:28           ` Randy Brukardt
2006-04-07 10:55 ` Stephen Leake
2006-04-07 21:19 ` John
replies disabled

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