From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from conssluserg-04.nifty.com (conssluserg-04.nifty.com [210.131.2.83]) by sourceware.org (Postfix) with ESMTPS id 352173858400 for ; Wed, 10 Nov 2021 13:31:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 352173858400 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-04.nifty.com with ESMTP id 1AADUlbD014859 for ; Wed, 10 Nov 2021 22:30:47 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-04.nifty.com 1AADUlbD014859 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.ne.jp; s=dec2015msa; t=1636551047; bh=bNWM2LIBV2F3MnQq3Llx0I/jJztAwTI+TN7AJNbGSZo=; h=Date:From:To:Subject:In-Reply-To:References:From; b=UA9871w2y9vTjCAYD4Bk4bj1tlr+aKt/zqtIwhSlodkbtJobM2s6wuma6nv58d9um FNtUaiA0DEtmtKlMPgocgEuzQvXMockr11FsyRAIBVor8J1y+os/YOpQg1e5BgSW3T 65aXMkDzAS3mqgKaPgqLijuqJnMKDSvA61ndKOG5guX12Taz9iFNSbHFx9zQzG2f34 4ChpjfLJcihEPVE+4I7UpRu+cb81IWrYRh2tM+Q6Zlw1IYLWBuy0JcYeJrvmlf71qY LI/YJjkwkxPpOPVXq+1d1QFExnXey1FDMl+f0VlQ/W3Kr3Fubujid3UjILF4r5dJDH TDj6NSvntrjOA== X-Nifty-SrcIP: [110.4.221.123] Date: Wed, 10 Nov 2021 22:30:49 +0900 From: Takashi Yano To: cygwin-developers@cygwin.com Subject: Re: 3.3.0: Possible regression in cygwin DLL (Win10); fixed in snapshot Message-Id: <20211110223049.b61c6cb87fb3e540b4214bcf@nifty.ne.jp> In-Reply-To: References: <20211105123950.b118a7f2ba38379764df4c12@nifty.ne.jp> <20211105170542.96ce6dd4ca32880ddfddd660@nifty.ne.jp> <20211106044116.698b465a5d8ed6ce2cc75c99@nifty.ne.jp> <2cfa5de7-3b95-9062-4572-f36d304bc916@cornell.edu> <20211106151047.4d8f626bd6ebe9e4d8017f3b@nifty.ne.jp> <20211110173003.88359e8482ffa8b8be326903@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.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, 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, 10 Nov 2021 13:31:20 -0000 On Wed, 10 Nov 2021 11:34:25 +0100 Corinna Vinschen wrote: > On Nov 10 17:30, Takashi Yano wrote: > > On Sat, 6 Nov 2021 12:42:46 +0100 > > Corinna Vinschen wrote: > > > On Nov 6 15:10, Takashi Yano wrote: > > > > Unfortunately, these solutions do not resolve the issue > > > > which is another issue with C# program: > > > > https://cygwin.com/pipermail/cygwin/2021-March/247987.html > > > > This still needs FILE_SYNCHRONOUS_IO_NONALERT flag. > > > > > > If we want to add FILE_SYNCHRONOUS_IO_NONALERT, this would have to be > > > solved by running NtReadFile/NtWriteFile synchronously in a thread, > > > started on every invocation of raw_read/raw_write. raw_read/raw_write > > > would then call cygwait on the thread object. To break on signal or > > > thread cancallation events, it would have to call CancelSynchronousIo. > > > That's certainly doable. > > > > I tried to implement your idea, however, I noticed that > > NtQueryObject(ObjectNameInformation) call in > > get_query_hdl_per_process() is blocked while reading the > > pipe if FIPE_SYNCHRONOUS_IO_NONALERT is set and pipe is > > in blocking mode. > > > > So I would like to propose alternative implementation with > > FILE_SYNCHRONOUS_IO_NONALERT being set. Please have a look > > at attached patch. With this patch, pipe itself in read side > > is always set to nonblocking mode and simulate the blocking > > behaviour in raw_read(). This can eliminate creating thread > > for reading as well as calling CancelSynchronousIo(). > > > > Note that setting FILE_SYNCHRONOUS_IO_NONALERT only for read > > pipe seems to be enough for C# programs. > > > > What do you think of this implementation? > > Can you push this to the topic/pipe branch for playing? I updated > the branch to current master. Thanks. I have just pushed the experimental patch to topic/pipe. Please try. If something wrong, please point it out. -- Takashi Yano