delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2021/08/28/07:58:53

X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 204CF385783D
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1630151931;
bh=pBvq3judVztmab/Xk+DpN4C2/kuADQIyQOErgfO2PZM=;
h=Date:To:Subject:References:In-Reply-To:List-Id:List-Unsubscribe:
List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:
From;
b=BCeGGHsA07X7PQeqvdxDkoRC4o5xC5C6wuwTJQcoHaIYOhk5kRUkmsJoQgc/dj/+f
kYyx6gDhIxymmzaodF5VCP0jPOnkSCG2/WGWEz3I0TCQEZVNeAiP5NIykCZfJl27cp
OMTznFP14kyMfhOG+GfQMuQSz+7nxiqnykE0lMYw=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 409743858435
Date: Sat, 28 Aug 2021 13:58:08 +0200
To: cygwin AT cygwin DOT com
Subject: Re: cygrunsrv + sshd + rsync = 20 times too slow -- throttled?
Message-ID: <YSok0PoCQn2TPPrn@calimero.vinschen.de>
Mail-Followup-To: cygwin AT cygwin DOT com
References: <20210825201845 DOT 07b6400b79dc5558a7761efe AT nifty DOT ne DOT jp>
<f8106fe7-a2b8-d106-3061-4d888124f4b0 AT cornell DOT edu>
<20210826062934 DOT 54f2f2216021c095bb7ba13b AT nifty DOT ne DOT jp>
<d0a8c57d-1ed1-6b4f-c6e7-cbe0e2ec8a1c AT cornell DOT edu>
<3b560051-ab27-f392-ca4b-d1fd9b5733b0 AT cornell DOT edu>
<20210827202440 DOT 47706fc2fc07c5e9a1bc0047 AT nifty DOT ne DOT jp>
<4f2cb5f3-ce9c-c617-f65f-841a5eca096e AT cornell DOT edu>
<20210828022111 DOT 91ef5b4ff24f6da9fadb489e AT nifty DOT ne DOT jp>
<YSn3L0W1M527utK0 AT calimero DOT vinschen DOT de>
<20210828184102 DOT f2206a8a9e5fe5cf24bf5e45 AT nifty DOT ne DOT jp>
MIME-Version: 1.0
In-Reply-To: <20210828184102.f2206a8a9e5fe5cf24bf5e45@nifty.ne.jp>
X-Provags-ID: V03:K1:6g5Jq9FjsQnxzegxlbfV/b6b4QSKUs3irtrKViMcdpE+mq+69y2
I7+bRjOzOf19tkze5HjUJqETJ8qGU0tBVS6IiBtnaGbzpHL4QlcG3S993ltPJaUe4IgGGl+
yxV+nB9NkwaOQPTzPkfycY+y4bZlBtIkjTR//NN3PkfVVUZU5iZDIukvMjG+YsUi4Whawog
mya2m2bFZMAkMEhE48znw==
X-UI-Out-Filterresults: notjunk:1;V03:K0:DBn3d0aSFkk=:OZygRTW6AJt4f9wZf6Q5v8
7CuSeV5oCYOnn3ci98lUN8JWN4F2j6El6Hp5+hcIun82WrMelq+ycfg8MM4NCNL37fK5Whfyp
K9T5SaL3xQ9P5i3yQM2w9BndY+idLGl/hGUXyvVAFgB4F8S+fc5Th5QbEPSsHrfJAZxHlKfZ2
o8iRj93T1XNPtg7OPmC7dArD1lsGZEWcECF6rPQmBsnjme+bmWuyoDVYkYC3T4eQNDzr55Ru0
HHDXmpvfZ6+aICOnom5Z8cKur6hq2Sk93Pk7x53EdDSJU7kkEGZJOnS4wc+W6q68inxtcmV5n
8bEMJsazyLzVwDeyCgNWcR1Qq84tEvC/OeEq/6ZSzSmx0MGYwIo7ptFXzMpyBDKNe/ScqsQ62
ATPowrjqNMFtDsXikhxUhXyB2Mxioy1xwAwVEK9OpakbvxcT1MwmX10zUFaC76R0wNW9fY1ec
a//8rhpRofzo/o2IiNpVC6GyZJYcnoRE2UJgmNAAG7699RzYDx9AJh+4Kk+iS9E7PI4pbZbGG
gSCEklktJeil+XGOgskYU2AnrH7ANQYke+xyvPnn+MkDoozE6wrBX7vhdX4JL/HnLbv3YROfU
X2IejBO5LHUIPTMoVTPWSVzg5svpyNxJmog0/0kugqHLIaPLkb2A3Ojp3To0ZSCsDJYihoXxl
LZxnNdnVhQ4ykYPMoZQZIQOIfV+t770ClWIBC1xWNbPIsnFJ6eYPAhnZgOPcwN94XWvtzTuHA
jYb/DR8TwPbE48XR/iBQh+ccRN6wlZY0BY/ykSKK2iYrIfqddoJ47uwVaIY=
X-Spam-Status: No, score=-99.8 required=5.0 tests=BAYES_00,
GOOD_FROM_CORINNA_CYGWIN, JMQ_SPF_NEUTRAL, KAM_DMARC_NONE, KAM_DMARC_STATUS,
RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NEUTRAL,
TXREP autolearn=ham autolearn_force=no version=3.4.4
X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on
server2.sourceware.org
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.29
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
From: Corinna Vinschen via Cygwin <cygwin AT cygwin DOT com>
Reply-To: cygwin AT cygwin DOT com
Cc: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
Errors-To: cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com>

On Aug 28 18:41, Takashi Yano via Cygwin wrote:
> On Sat, 28 Aug 2021 10:43:27 +0200
> Corinna Vinschen wrote:
> > On Aug 28 02:21, Takashi Yano via Cygwin wrote:
> > > On Fri, 27 Aug 2021 12:00:50 -0400
> > > Ken Brown wrote:
> > > > Two years ago I thought I needed nt_create to avoid problems when calling 
> > > > set_pipe_non_blocking.  Are you saying that's not an issue?  Is 
> > > > set_pipe_non_blocking unnecessary?  Is that the point of your modification to 
> > > > raw_read?
> > > 
> > > Yes. Instead of making windows read function itself non-blocking,
> > > it is possible to check if the pipe can be read before read using
> > > PeekNamedPipe(). If the pipe cannot be read right now, EAGAIN is
> > > returned.
> > 
> > The problem is this:
> > 
> >   if (PeekNamedPipe())
> >     ReadFile(blocking);
> > 
> > is not atomic.  I. e., if PeekNamedPipe succeeds, nothing keeps another
> > thread from draining the pipe between the PeekNamedPipe and the ReadFile
> > call.  And as soon as ReadFile runs, it hangs indefinitely and we can't
> > stop it via a signal.
> 
> Hmm, you are right. Mutex guard seems to be necessary like pty code
> if we go this way.
> 
> > Is a blocking ReadFile actually faster than a non-blocking read?  Or
> > does it mainly depend on BYTE vs. MESSAGE mode?
> 
> Actually, I don't think so. Perhaps it is not essential problem of
> overlapped I/O but something is wrong with current pipe code.
> 
> > What if the pipe is created non-blocking and stays non-blocking all the
> > time and uses BYTE mode all the time?  Just as sockets, it would always
> > only emulate blocking mode.  Wouldn't that drop code size a lot and fix
> > most problems?
> 
> If 'non-blocking' means overlapped I/O, only the problem will be:
> https://cygwin.com/pipermail/cygwin/2021-March/247987.html

Sorry if that wasn't clear, but I was not talking about overlapped I/O,
which we should get rid off, but of real non-blocking mode, which
Windows pipes are fortunately capable of.


Corinna

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019