cygrunsrv + sshd + rsync = 20 times too slow -- throttled?

Corinna Vinschen corinna-cygwin@cygwin.com
Wed Sep 1 08:13:01 GMT 2021


On Sep  1 10:03, Corinna Vinschen wrote:
> On Sep  1 11:39, Takashi Yano wrote:
> > On Tue, 31 Aug 2021 17:20:25 +0200
> > Corinna Vinschen wrote:
> > > On Aug 31 20:05, Takashi Yano wrote:
> > > > On Tue, 31 Aug 2021 11:04:05 +0200
> > > > Corinna Vinschen wrote:
> > > > > On Aug 31 17:52, Takashi Yano wrote:
> > > > > > With FILE_SYNCHRONOUS_IO_NONALERT, what kind of problems are you
> > > > > > specifically concerned about cygwin pipe? 
> > > > > 
> > > > > We're using asynchronous IO to be able to call WFMO and thus to be able
> > > > > to handle signals and thread cancellation events.  Wit hsynchronous IO
> > > > > this is not possible.
> > > > 
> > > > Thanks. How can I regenerate above issue? Stopping by Ctrl-C or killing
> > > > the process by kill seems to work even with FILE_SYNCHRONOUS_IO_NONALERT.
> > > 
> > > It may depend on the thread you're running this in.  But really, just
> > > call a blocking (SYNCHRONIZE + FILE_SYNCHRONOUS_IO_NONALERT) ReadFile
> > > in the main thread of a Cygwin app, and you'll see that neither Ctrl-C
> > > nor kill signalling will get through.
> > 
> > I confirmed the issue with FILE_SYNCHRONOUS_IO_NONALERT.
> 
> There's, of course, a workaround.  If you start a thread for each
> synchronous ReadFile/WriteFile, you can cygwait in the caller for the
> thread, rather than for the event object of the async IO.  If a signal
> or a thread cancellation request arrives, you can then call
> CancelSynchronousIo on the ReadFile/WriteFile thread and wait for thread
> termination.  I implemented something along these lines in
> fhandler_disk_file::mand_lock.
> 
> Maybe something to consider?  It would certainly fix the C# issue,
> but I'm reluctant to do the thread juggle for each read/write.

Oh, yeah, there's still the problem that NtQueryInformationFile on the
read side hangs when called during a synchronous ReadFile, as I learned
two days ago...


Corinna


More information about the Cygwin-developers mailing list