From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from conssluserg-03.nifty.com (conssluserg-03.nifty.com [210.131.2.82]) by sourceware.org (Postfix) with ESMTPS id 4BF403858D29 for ; Wed, 8 Sep 2021 04:11:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4BF403858D29 Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=nifty.ne.jp Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=nifty.ne.jp Received: from Express5800-S70 (z221123.dynamic.ppp.asahi-net.or.jp [110.4.221.123]) (authenticated) by conssluserg-03.nifty.com with ESMTP id 1884BUUX004404 for ; Wed, 8 Sep 2021 13:11:31 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-03.nifty.com 1884BUUX004404 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.ne.jp; s=dec2015msa; t=1631074291; bh=OBl5A18B2GQH2HAssKjr6Z15scGqIcHVTe77Zz+MlJo=; h=Date:From:To:Subject:In-Reply-To:References:From; b=f/m/Dz7xiblrSoNpFf1S5is4U2V6XgXWGwT4ztcc7pgWjcF6DestRvbrVLStyG3D/ porEqb6hE4ZNoG2C7DwSRl+efF19T/Y41IDvhyVPQ4jedyyawtagMxtOioJpaxr+hU tHS0BBoRuv8gzq8G+lJ6Y0D0sYUMW4JwdhZ2pyyz3LpED4TJvRN4wib5STQFi+eRvx 0whcRFsB59+4yhapCw0S/px9m4zWrMeuJQtOsinsQsY0pGmOu0+l34Dkit8E25bv09 bQ1G51LOXmq4KQkUUOh6cluLNedFDAXpKNqKNEr/M68hnI9DOZsJvYGPW+JnegkVG2 BBDQ0ZSqNf+0g== X-Nifty-SrcIP: [110.4.221.123] Date: Wed, 8 Sep 2021 13:11:41 +0900 From: Takashi Yano To: cygwin-developers@cygwin.com Subject: Re: cygrunsrv + sshd + rsync = 20 times too slow -- throttled? Message-Id: <20210908131141.bf63a795ce13c8dd8f5c13a8@nifty.ne.jp> In-Reply-To: <20210908090748.3e70ed5aea3fa3c320b5ae0d@nifty.ne.jp> References: <41A583E1-C8E7-42AB-9F24-EEC33A41EC60@house.org> <20210825201845.07b6400b79dc5558a7761efe@nifty.ne.jp> <20210826062934.54f2f2216021c095bb7ba13b@nifty.ne.jp> <3b560051-ab27-f392-ca4b-d1fd9b5733b0@cornell.edu> <20210827202440.47706fc2fc07c5e9a1bc0047@nifty.ne.jp> <20210907122631.65452be8d021ec72259431d5@nifty.ne.jp> <20210907195023.31ad8194457bb90c2b6971b4@nifty.ne.jp> <20210908090748.3e70ed5aea3fa3c320b5ae0d@nifty.ne.jp> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.30; i686-pc-mingw32) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, 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-developers@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin core component developers mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Sep 2021 04:12:02 -0000 On Wed, 8 Sep 2021 09:07:48 +0900 Takashi Yano wrote: > On Tue, 7 Sep 2021 19:50:23 +0900 > Takashi Yano wrote: > > > @@ -796,7 +792,8 @@ pipe_cleanup (select_record *, select_stuff *stuff) > > pi->stop_thread = true; > > SetEvent (pi->bye); > ~~~~~~~~~~~~~~~~~~~ > This is not correct. SetEvent() wakes-up one of thread_pipe()s, > but it may be other thread than one which should be stopped. > > > pi->thread->detach (); > > - CloseHandle (pi->bye); > > + if (me->fh->get_select_evt () == NULL) > > + CloseHandle (pi->bye); > > } > > delete pi; > > stuff->device_specific_pipe = NULL; > > I think it also should be > > + for (ULONG i = 0; i < get_obj_handle_count (select_evt); i++) > > + SetEvent (select_evt); > > Actually I want to use PulseEvent() here if it is not **UNRELIABLE**. > https://docs.microsoft.com/en-us/windows-hardware/drivers/devtest/28648-pulseevent-is-an-unreliable-function > > Does using semaphore object instead of event, and releasing > resources equal to the number of handles make sense? No it does not. One thread may consume semaphore multiple times.... -- Takashi Yano