From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) by sourceware.org (Postfix) with ESMTPS id 741E4385E02F for ; Wed, 1 Apr 2020 17:14:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 741E4385E02F Received: by mail-lf1-x12c.google.com with SMTP id h6so329791lfp.6 for ; Wed, 01 Apr 2020 10:14:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:references:in-reply-to:subject:date :message-id:mime-version:content-transfer-encoding:content-language :thread-index; bh=hInPBMjjGEYV+8/HOgljBT/jkW1gs54cdUxmpmAJ5WE=; b=cCxMXp5yodM0un4UsoNaM6gIyn5UtmFltP2YFSVHwPAQB42pnb/NLyl4PDUWJnvH/3 AU1Xwr5vRd0ZOcJ3M6en83I2Y3hwU3oemtH4sYA6CMH/TP0/jfzpUJcM7cmqNUnqi5bL sZ2q7Z65xCqA73pkIlnIvkGd+kyEaUnRCiCQ+B+R04Fa961GaTX8lOre7sUAKlb6oLSu IDJKkm2YweGHyj6LY3Tqvy7WhIr4OUwz+CBzFnwiMousdYgDhQkPTvOAO48IG6FWeqeT tkge0C8/cfb9T4z0JG4vqUNx0tgeUvbM5H8RhVmpS7ge0OoOkoiv1tcPWH4FSBALHtho zqrg== X-Gm-Message-State: AGi0PuZeMD3TyeHkyLvLEHrI6df4xR3dC/a3Sn0PUvhbVl4Hsv5ifngM OVgUwmrQwAyNtKwJhJ1yKwf48G/K X-Google-Smtp-Source: APiQypLjwkc+ZC5hyS5P7HDjMY7771N3aKvCKhWD4W11y8YmRRv+e0A2OUm6q4+ZBCY8E7Ubxz64hw== X-Received: by 2002:a19:4ad4:: with SMTP id x203mr15338658lfa.64.1585761263755; Wed, 01 Apr 2020 10:14:23 -0700 (PDT) Received: from JOKK (87-249-164-127.ljusnet.se. [87.249.164.127]) by smtp.gmail.com with ESMTPSA id n22sm1464102lfe.8.2020.04.01.10.14.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 Apr 2020 10:14:22 -0700 (PDT) From: To: "'Ken Brown'" Cc: "'cygwin'" References: <1b1401d60296$2769e690$763db3b0$@gmail.com> <716e2076-f607-454e-2723-937c3959e2a3@cornell.edu> <18be01d602ab$0bbfca30$233f5e90$@gmail.com> <35b43b59-6410-f21f-710c-385e39cbae0b@cornell.edu> <005201d603ba$2bc8ab20$835a0160$@gmail.com> <472d1df6-531a-ebd7-4ffa-583a06e270ff@cornell.edu> <00b901d60447$7ecb4c50$7c61e4f0$@gmail.com> <00e001d604f9$d0aa0720$71fe1560$@gmail.com> <8c6c5655-c162-8361-9f44-376bbd7cf114@cornell.edu> <3fe06192-7300-382a-8c98-f1bc2ff81e36@cornell.edu> <003701d607a0$c975f140$5c61d3c0$@gmail.com> <249be61e-da8a-7da1-ca67-0c4c6433a415@cornell.edu> <000a01d60802$d1525900$73f70b00$@gmail.com> In-Reply-To: Subject: Sv: Sv: Sv: Sv: Sv: Sv: Sv: Named pipes and multiple writers Date: Wed, 1 Apr 2020 19:14:21 +0200 Message-ID: <001601d60848$fcffd320$f6ff7960$@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 16.0 Content-Language: en-gb Thread-Index: AQJE9fQg8TMZuJRGwTEKbo0ZGNgDeQHtMggPA01jw/MCH/KUAAKPevBvAf/qW+kC4eksHQHeBGSzAqmcYp4CB8F8lwIBR+2oARkkbuUCauCM3AJYP32sAmYz8EcC5hrYQwEcxqeZAcg8ToumW1EdAA== X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: cygwin@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Apr 2020 17:14:27 -0000 > On 4/1/2020 4:52 AM, sten.kristian.ivarsson@gmail.com wrote: > >> On 3/31/2020 5:10 PM, sten.kristian.ivarsson@gmail.com wrote: > >>>> On 3/28/2020 10:19 PM, Ken Brown via Cygwin wrote: > >>>>> On 3/28/2020 11:43 AM, Ken Brown via Cygwin wrote: > >>>>>> On 3/28/2020 8:10 AM, sten.kristian.ivarsson@gmail.com wrote: > >>>>>>>> On 3/27/2020 10:53 AM, sten.kristian.ivarsson@gmail.com = wrote: > >>>>>>>>>> On 3/26/2020 7:19 PM, Ken Brown via Cygwin wrote: > >>>>>>>>>>> On 3/26/2020 6:39 PM, Ken Brown via Cygwin wrote: > >>>>>>>>>>>> On 3/26/2020 6:01 PM, sten.kristian.ivarsson@gmail.com = wrote: > >>>>>>>>>>>>> The ENIXIO occurs when parallel child-processes > >>>>>>>>>>>>> simultaneously using O_NONBLOCK opening the descriptor. > >>>>>>>>>>>> > >>>>>>>>>>>> This is consistent with my guess that the error is > >>>>>>>>>>>> generated by fhandler_fifo::wait.=A0 I have a feeling = that > >>>>>>>>>>>> read_ready should have been created as a manual-reset > >>>>>>>>>>>> event, and that more care is needed to make sure it's set when it should be. [snip]=20 > >>>>> Never mind.=A0 I was able to reproduce the problem and find the = cause. > >>>>> What happens is that when the first subprocess exits, > >>>>> fhandler_fifo::close resets read_ready.=A0 That causes the = second > >>>>> and subsequent subprocesses to think that there's no reader = open, > >>>>> so their attempts to open a writer with O_NONBLOCK fail with = ENXIO. [snip]=20 > > I wrote in a previous mail in this topic that it seemed to work fine > > for me as well, but when I bumped up the numbers of writers and/or = the > > number of messages (e.g. 25/25) it starts to fail again [snip]=20 > Yes, it is a resource issue. There is a limit on the number of = writers that can be open at one > time, currently 64. I chose that number arbitrarily, with no idea = what might actually be > needed in practice, and it can easily be changed. Does it have to be a limit at all ? We would rather see that the = application decide how much resources it would like to use. In our particular case = there will be a process-manager with an incoming pipe that possible several thousands of processes will write to Just for fiddling around (to figure out if this is the limit that make = other things work a bit odd), where's this 64 limit defined now ? > In addition, a writer isn't recognized as closed until a reader tries = to read and gets an error. > In your example with 25/25, the list of writers quickly gets to 64 = before the parent ever tries > to read. That explains the behaviour, but should there be some error returned = from open/write (maybe it is but I'm missing it) ? > I'll see if I can find a better way to manage this. >=20 > Ken Kristian Kristian=20