delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2018/12/11/14:40:45

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:date:from:to:subject:message-id:reply-to
:references:mime-version:content-type:in-reply-to; q=dns; s=
default; b=DttBC23VETc/as0nvs9SelvoFisObLw+NmSIXUeh3w9YirGG91R+E
qVoihDY5OJTM1jtojDqcgOrjTWgwKMyrIeCBSmMGVDAtvRtcfIQ1yymcrAqc4LC5
F+3ThpsGjjzK5ghasP6x4KfUNe0UP9nAl6IE/l6eAeBc3bN8C8QEhA=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:date:from:to:subject:message-id:reply-to
:references:mime-version:content-type:in-reply-to; s=default;
bh=IfHtPB6izU9ln0O7BshOTqQHjCM=; b=hFtkMvU7vkT89OxlvJdlbzGe+7cy
jRlw6RVnL3C2TrEO9Zq8Zbs0umETUH/ssudeqm7LGp+y+4iIwc5vvBHtDMqE+v56
sl+yrbmBXw9HyWpQTTwJj5o8I0yAJAdK540/OGtHVFwLBBjR4/t9N5uuZCLy9B5k
I4ap2tIxEfm1k6Q=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
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
Date: Tue, 11 Dec 2018 20:40:27 +0100
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: Problem with named pipes
Message-ID: <20181211194027.GG3972@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <567DB7AB DOT 5060606 AT cornell DOT edu> <20160108205008 DOT GM20447 AT calimero DOT vinschen DOT de> <d5ff7ebb-6fc2-5ce6-e38b-6e6c9113d102 AT cornell DOT edu>
MIME-Version: 1.0
In-Reply-To: <d5ff7ebb-6fc2-5ce6-e38b-6e6c9113d102@cornell.edu>
User-Agent: Mutt/1.9.2 (2017-12-15)

--yNb1oOkm5a9FJOVX
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

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"

-----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--

- Raw text -


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