[Fwd: 1.5.11-1: sftp performance problem]

Christopher Faylor cgf-no-personal-reply-please@cygwin.com
Mon Sep 13 18:18:00 GMT 2004

On Mon, Sep 13, 2004 at 02:09:37PM -0400, Bob Byrnes wrote:
>>Or what if a read from a pipe always asks for the number of available
>>bytes using NtQueryInformationFile and then only actually reads this
>>number of bytes and returns that to the caller?
>-- End of excerpt from Corinna Vinschen
>That's similar to nonblocking reads, and it might work, and I guess for
>blocking reads we would never attempt to read more than the size of the
>pipe minus PIPE_BUF.  If we don't want to return partial data, then we
>could redo reads until all of the data is delivered to the calling
>program, but I think partial reads should be OK.

The only problem with that scenario is that there is a race there where
you may end up reading fewer bytes than are actually on the pipe but
I guess that all pipe I/O is inherently racy to some extent.


More information about the Cygwin-patches mailing list