Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 03 Feb 2004 16:30:54 +0000
From:      Peter Edwards <peter.edwards@openet-telecom.com>
To:        Robert Watson <rwatson@FreeBSD.org>
Cc:        current@FreeBSD.org
Subject:   Re: Coalescing pipe allocation
Message-ID:  <401FCCBE.2010008@openet-telecom.com>
In-Reply-To: <Pine.NEB.3.96L.1040131234955.17012E-100000@fledge.watson.org>
References:  <Pine.NEB.3.96L.1040131234955.17012E-100000@fledge.watson.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Robert Watson wrote:

>On Sun, 1 Feb 2004, Dag-Erling Smørgrav wrote:
>
[snip]

>>I think our biggest problem with pipes is not half-open pipes but rather
>>their absence; most of the code that uses pipes only uses one direction
>>and does not bother to shut the other down.
>>
[snip]
How would one "shut down" one direction of the pipe and still maintain 
the other? I don't know how I can signal my intention not to read or 
write to the end I leave open...

>Yeah, I was interested by this observation -- many applications don't even
>think pipes are bi-directional, meaning that doing work allocating pipe
>map space for both directions basically wastes half the work. 
>
The applications that do this are only doing what's recommended of them. 
>From the pipe(2) manpage:

>      The bidirectional nature of this implementation of pipes is not 
> portable
>      to older systems, so it is recommended to use the convention for 
> using
>      the endpoints in the traditional manner when using a pipe in one 
> direc-
>      tion.

I have certainly taken that at face value at least once when deciding on 
how to use (or not use) pipes.
Is this portability issue so ridiculously out of date that the comment 
in the pipe(2) manpage should be removed, or at least toned down? It 
seems silly to incur the costs of implementation you've mentioned and 
then recommend that the feature not be used.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?401FCCBE.2010008>