From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 107690 invoked by alias); 11 Dec 2018 19:40:34 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 107666 invoked by uid 89); 11 Dec 2018 19:40:33 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-100.9 required=5.0 tests=BAYES_00,GOOD_FROM_CORINNA_CYGWIN,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy=connected, Hx-spam-relays-external:sk:mrelaye, H*RU:sk:mrelaye, H*r:sk:mrelaye X-HELO: mout.kundenserver.de Received: from mout.kundenserver.de (HELO mout.kundenserver.de) (212.227.126.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 11 Dec 2018 19:40:32 +0000 Received: from calimero.vinschen.de ([217.91.18.234]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1M9Wqa-1gTUVd13P2-005b3v for ; Tue, 11 Dec 2018 20:40:29 +0100 Received: by calimero.vinschen.de (Postfix, from userid 500) id 005B2A803C8; Tue, 11 Dec 2018 20:40:27 +0100 (CET) Date: Tue, 11 Dec 2018 19:40:00 -0000 From: Corinna Vinschen To: cygwin@cygwin.com Subject: Re: Problem with named pipes Message-ID: <20181211194027.GG3972@calimero.vinschen.de> Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com References: <567DB7AB.5060606@cornell.edu> <20160108205008.GM20447@calimero.vinschen.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="yNb1oOkm5a9FJOVX" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) X-SW-Source: 2018-12/txt/msg00104.txt.bz2 --yNb1oOkm5a9FJOVX Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 2256 On Dec 11 14:42, Ken Brown wrote: > On 1/8/2016 3:50 PM, Corinna Vinschen wrote: > > On Dec 25 16:39, Ken Brown wrote: > >> I've noticed a difference between Cygwin and Linux involving named pip= es. I > >> don't know if this a bug or simply a difference. > >> > >> Consider the following two scripts: > >> [...] > >> > >> The problem disappears if I remove the line "exec 7>foo" from fifo1.sh= . The > >> problem also disappears if I leave that line in, but change the last l= ine to > >> "echo blah >&7". > >=20 > > Very tricky problem. The FIFO code falls over its own feet trying to > > handle more than one writer (exec 7> is the first, echo blah is the > > second writer). Sigh. This code needs a thorough rewrite... >=20 > Hi Corinna, >=20 > I'm coming back to this thread after three years. I'd be willing to put = in some=20 > time working on this, if you could point me in the right direction. Do y= ou have=20 > ideas about what a rewrite of the FIFO code might look like? > The one idea that I had was that a reader could open several instances of= the=20 > Windows named pipe, allowing several writers to connect to it simultaneou= sly. I=20 > think that would solve the particular problem I reported (and the similar= =20 > problem cited by Houder up-thread). But it would just be a band-aid, and= Cygwin=20 I think this is not required, as long as at least one instance of the pipe is available at all times. Perhaps the unfinished, new AF_UNIX sockets code can be reused or partially duplicated to implement FIFOs. The fhandler_socket_unix::accept4 function tries to emulate that behaviour. As soon as a client connects, it spawns another pipe instance and uses that as listener handle, while the previous accepting pipe handle is now connected with the client and is what gets used for the new, accepted descriptor. > FIFOs still wouldn't be POSIX compliant. Yeah, this is really tricky to get with Windows pipe semantics. I guess if the most common scenarios are covered, we're good. Thanks a lot for looking into that. Feel free to discuss any and all implementation details on the developers ML. I guess it's time to pick up the AF_UNIX pieces myself next year :} Corinna --=20 Corinna Vinschen Cygwin Maintainer --yNb1oOkm5a9FJOVX Content-Type: application/pgp-signature; name="signature.asc" Content-length: 833 -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEoVYPmneWZnwT6kwF9TYGna5ET6AFAlwQEqsACgkQ9TYGna5E T6CqNxAAnJUVtCx4QOYltWa8gt2da6pwszST/poSckZgaTEgwcA3YKeQob7ntOqs NyWZB4i7hEk9vHF5+1JGQ9av7fKpS9af2k72FGKY8GSmZZANPoAnLMV8H4yR9rP8 J4Otoiogda9r+iVXMoE5fZ0ME8/EhvEYCR5B8GbxoKM6eHDF4XfVvyy6ZoUOcieu YXw7cyNA5K/ZTZ+IbcCQvQSRai0atojCzGM+NtA0lkXhLqMEf4luWzbvdelUv2D8 BpWUUtAcug2wnLwYMNR0MorherlRqf0jXuF7ivJMt/oHAXJQmjTEFitzKudOhZNJ WMxJsXuvu1kpcptN/psj4rGNtzCz9ZjMc3kLqzb3j1smmPyvX15x8FebswNtvh5j cgA2NDRyfQi0rhPSxh+cWY9ccY7Og9AsxZk0qGBzdaZhlowllacZ4Hv9aSyo8a1u 5LTOB2fxd0TJ9x4ijxs4O2DyPCcXH98woYbYasepH2UKYKr92ILfWL2or+k0/VKT nHTQMb5aHVj4qUmtJX87FhbOUe24wxjE5vUVGjOKzL9MwEeDIhUdJztAXG7SOfNf RzWajkgUXlNKHVkvKQLzg8rFZP1U+hrTL1q3if/KM9rgF/gBibL06cxdiWpdgetW 3FYoUqmFnhB4jAllfmvagX6Eu57PRhiiC50oRI7vLWvL1alJTdE= =5vuo -----END PGP SIGNATURE----- --yNb1oOkm5a9FJOVX--