Asynchronous pipe I/O

Peter Jeremy peterjeremy at optushome.com.au
Wed Nov 5 10:13:13 PST 2008


On 2008-Nov-05 17:40:11 +0400, rihad <rihad at mail.ru> wrote:
>Imagine this shell pipeline:
>
>sh prog1 | sh prog2
>
>
>As given above, prog1 blocks if prog2 hasn't yet read previously written
>data (actually, newline separated commands) or is busy. What I want is
>for prog1 to never block:
>
>sh prog1 | buffer | sh prog2

There's also misc/mbuffer which is supposed to be an enhancement of
misc/buffer - though I haven't used either.  I have a program I wrote
to do this but it's not in a releasable state.

>Wouldn't such an intermediary tool be a great way to boost performance
>for certain types of solutions?

I've found that for dump|restore or dump|gzip, I can get quite significant
speedups by adding a buffer that is several hundred MB in the middle.

-- 
Peter Jeremy
Please excuse any delays as the result of my ISP's inability to implement
an MTA that is either RFC2821-compliant or matches their claimed behaviour.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20081105/6de97308/attachment.pgp


More information about the freebsd-hackers mailing list