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 20:51:01 +0200
Date: 2006-04-07T20:50:59+02:00	[thread overview]
Message-ID: <z04b2805sbm0$.175pkrmufklqh$.dlg@40tude.net> (raw)
In-Reply-To: 1144427423.152451.170970@j33g2000cwa.googlegroups.com

On 7 Apr 2006 09:30:23 -0700, Le wrote:

> 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.

If you mean a byte stream, then it is *byte* you (or application) should
know of. You cannot read any device not knowing the size of input. You
might have a higher level communication protocol which build something out
of these bytes, for example, "a valid Ada program encoded in ASCII." But
how an OS driver might know about it?

> The ReadFile interface *is* blocking.  Overlap allows an app to come
> back and see if it is done.

Then it is rather a strange definition of "blocking." In my world blocking
operation means that the execution thread gets blocked until its completes.
The thread cannot go anywhere it that state.

> 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.

How so? Byte-wise reading just does not do any extra and unnecessary
buffering, because OS already did it. One could argue that OS API are
expensive to call. This a different issue. I don"t have any figures
concerning Windows, but in my experience that was never a problem. At least
when reading from sockets and serial devices.

As for overlapping ReadFile, your argument does not apply either, because
it gets *all available* bytes the buffer provided in its argument can take.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



  reply	other threads:[~2006-04-07 18:51 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
2006-04-07 16:30   ` Le
2006-04-07 18:51     ` Dmitry A. Kazakov [this message]
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