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 22:49:04 +0200
Date: 2006-04-07T22:49:02+02:00	[thread overview]
Message-ID: <gxc2yafqm715$.fbas8dcsie8x.dlg@40tude.net> (raw)
In-Reply-To: 1144437671.065921.226960@e56g2000cwe.googlegroups.com

On 7 Apr 2006 12:21:11 -0700, Le wrote:

>>You cannot read any device not knowing the size of input.
> 
> You referred to blocks & lines previously indicating that you
> understood what was being referred to.

No, I didn't. Blocks were mentioned having block-oriented devices in mind.
Lines were for record-oriented I/O existed, for example, in RSX-11.

> I was speaking of byte sequences which vary in *length*.

which length is determined by what?

> ... ReadFile blocks or times out.

This is plain wrong. Here is the citation from MSDN "Synchronization and
Overlapped Input and Output"

"The WriteFile, ReadFile, DeviceIoControl, WaitCommEvent, ConnectNamedPipe,
and TransactNamedPipe functions can be performed either synchronously or
asynchronously."

and further:

"... Functions called for overlapped operation can return immediately, even
though the operation has not been completed. This enables a time-consuming
I/O operation to be executed in the background while the calling thread is
free to perform other tasks. For example, a single thread can perform
simultaneous I/O operations on different handles, or even simultaneous read
and write operations on the same handle."

From MSDN "ReadFile"

"... If hFile is opened with FILE_FLAG_OVERLAPPED and lpOverlapped is not
NULL, the read operation starts at the offset that is specified in the
OVERLAPPED structure, and ReadFile may return before the read operation is
complete. In this scenario, ReadFile returns FALSE and the GetLastError
function returns ERROR_IO_PENDING, which allows the calling process to
continue while the read operation completes."

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



  reply	other threads:[~2006-04-07 20:49 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
2006-04-07 19:21       ` Le
2006-04-07 20:49         ` Dmitry A. Kazakov [this message]
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