Coalescing pipe allocation
Robert Watson
rwatson at FreeBSD.org
Tue Feb 3 08:56:59 PST 2004
On Tue, 3 Feb 2004, Peter Edwards wrote:
> 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.
Well, I don't know so much about the portability issues, but I can say
that it seems silly to incur the costs if few applications take advantage
of the feature. Especially if the cost can be defered until the feature
is exercised. I have some local patches that defer all pipe buffer
allocation until a particular direction is first used, but this has some
potential downsides, including increasing the chances that a lack of
resources is discovered on first-use, rather than on allocation of the
pipe (which makes it a lot harder to write robust applications). Another
issue to look at is keeping a pool of buffers to amortize the cost of
allocation from the pipe_map, which is something I've also started looking
at. I haven't tried benchmarking the differences as yet.
Robert N M Watson FreeBSD Core Team, TrustedBSD Projects
robert at fledge.watson.org Senior Research Scientist, McAfee Research
More information about the freebsd-current
mailing list