From owner-freebsd-current@FreeBSD.ORG Tue Feb 3 09:14:40 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2985216A4CE for ; Tue, 3 Feb 2004 09:14:40 -0800 (PST) Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id D809C43D3F for ; Tue, 3 Feb 2004 09:14:37 -0800 (PST) (envelope-from robert@fledge.watson.org) Received: from fledge.watson.org (localhost [127.0.0.1]) by fledge.watson.org (8.12.10/8.12.10) with ESMTP id i13HC2Ud080029; Tue, 3 Feb 2004 12:12:02 -0500 (EST) (envelope-from robert@fledge.watson.org) Received: from localhost (robert@localhost)i13HC2cp080026; Tue, 3 Feb 2004 12:12:02 -0500 (EST) (envelope-from robert@fledge.watson.org) Date: Tue, 3 Feb 2004 12:12:02 -0500 (EST) From: Robert Watson X-Sender: robert@fledge.watson.org To: Dag-Erling =?iso-8859-1?q?Sm=F8rgrav?= In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE cc: current@FreeBSD.org Subject: Re: Coalescing pipe allocation X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Feb 2004 17:14:40 -0000 On Tue, 3 Feb 2004, Dag-Erling Sm=F8rgrav wrote: > Peter Edwards writes: > > Dag-Erling Sm=F8rgrav wrote: > > > Peter Edwards 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