On 12-Mar-06, at 2:22 PM, Samuel Montgomery-Blinn wrote:
>
> Doesn't this waste time not reading the input port while writing to
> the output port if the input port could be read while the output
> port is being written, and similarly waste time not writing to the
> output port while reading from the input port?
>
> -Sam
If you have a single CPU, it will either be filling the buffer
(reading) or draining the buffer (writing). So it can't really do
both at the same time. However, your disk, network card, and CPU can
all be working in parallel because the network card and disk have
internal buffers (i.e. when the write-subu8vector returns, the
network card (and TCP stack) will still be actively sending packets
out, which leaves enough time for the next disk access to occur). Of
course YMMV depending on the speed of the CPU, network card and
disk. Just measure how close you can get to the bandwidth of your
network. I'm confident you will be pretty close.
Marc