Re: Palatable Windows IO using Ada
- From: "Dmitry A. Kazakov" <mailbox@xxxxxxxxxxxxxxxxx>
- Date: Fri, 7 Apr 2006 09:29:42 +0200
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
.
- Follow-Ups:
- Re: Palatable Windows IO using Ada
- From: Steve
- Re: Palatable Windows IO using Ada
- From: Le
- Re: Palatable Windows IO using Ada
- References:
- Palatable Windows IO using Ada
- From: Le
- Palatable Windows IO using Ada
- Prev by Date: Re: How did dynamic elaboration fix cyclic elaboration error???
- Next by Date: Re: Advice on low level file handling.
- Previous by thread: Palatable Windows IO using Ada
- Next by thread: Re: Palatable Windows IO using Ada
- Index(es):
Relevant Pages
|