Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 3 Feb 2004 12:12:02 -0500 (EST)
From:      Robert Watson <rwatson@FreeBSD.org>
To:        Dag-Erling =?iso-8859-1?q?Sm=F8rgrav?= <des@des.no>
Cc:        current@FreeBSD.org
Subject:   Re: Coalescing pipe allocation
Message-ID:  <Pine.NEB.3.96L.1040203121006.79056G-100000@fledge.watson.org>
In-Reply-To: <xzpsmhs5c39.fsf@dwp.des.no>

next in thread | previous in thread | raw e-mail | index | archive | help

On Tue, 3 Feb 2004, Dag-Erling Sm=F8rgrav wrote:

> Peter Edwards <peter.edwards@openet-telecom.com> writes:
> > Dag-Erling Sm=F8rgrav wrote:
> > > Peter Edwards <peter.edwards@openet-telecom.com> writes:
> > > > How would one "shut down" one direction of the pipe and still maint=
ain
> > > > the other? I don't know how I can signal my intention not to read o=
r
> > > > write to the end I leave open...
> > > man 2 shutdown
> > Shutdown requires a socket, and won't play with pipes:
>=20
> hmm, you're right.  I was convinces that it was possible to shut down
> one half of a pipe...

At one point it may have been, when pipes were implemented using a
socketpair.  However, on recent FreeBSD, this is not the case.  Many
systems do implement pipes using socket pairs still, including Darwin.=20
Our pipe implementation will typically substantially out-perform socket
pair implementations on the same hardware (often 150% or more for
throughput).  In fact, NetBSD recently picked up a modified version of our
pipe implementation for this reason, I believe.  However, it was
side-by-side benchmarking of the resources required to allocate pipes vs.
sockets that caused me to investigate optimizing the allocation process,
as it still costs a lot more to allocate a pipe than a socket pair.=20

Robert N M Watson             FreeBSD Core Team, TrustedBSD Projects
robert@fledge.watson.org      Senior Research Scientist, McAfee Research




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.NEB.3.96L.1040203121006.79056G-100000>