On Tue, 3 Feb 2004, Dag-Erling Smørgrav wrote: > Peter Edwards <peter.edwards_at_openet-telecom.com> writes: > > Dag-Erling Smørgrav wrote: > > > Peter Edwards <peter.edwards_at_openet-telecom.com> writes: > > > > 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... > > > man 2 shutdown > > Shutdown requires a socket, and won't play with pipes: > > 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. 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. Robert N M Watson FreeBSD Core Team, TrustedBSD Projects robert_at_fledge.watson.org Senior Research Scientist, McAfee ResearchReceived on Tue Feb 03 2004 - 08:14:40 UTC
This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:41 UTC