How to make 4.2BSD ``/etc/dumps faster
Dave Martindale
dmmartindale at watcgl.UUCP
Fri Jan 4 15:13:29 AEST 1985
In article <6894 at brl-tgr.ARPA> chris at maryland (Chris Torek) writes:
>I figured pipes would be fairly slow 'cause the network interface
>limits you to 2048 bytes per transfer (although you can increase
>it). This means that for a 10240 block write (like dump() uses)
>you need 5 pairs of context switches, which can beat a 750 into
>the ground pretty well. Also, it makes it harder to communicate
>success/failure statuses.
>
Passing *data* though the pipes would indeed be slow. But I suspect that
the original author did the same thing I did for a general double-buffered
block copy routine: have two processes, one reading and writing even-numbered
blocks and one doing odd-numbered ones, and using pipes only for
synchronization to make sure that the reads and writes occur in the correct
logical sequence (in case either input or output is a tape drive).
Actually, the one-byte values passed around via the pipes can also encode
various types of special conditions, to ensure that one process quits
when the other detects an EOF or error for example. You can come quite
close to making the program behave like it was a single process that
just overlaps reads and writes.
More information about the Comp.unix.wizards
mailing list