Network pipes

Diomidis Spinellis dds at aueb.gr
Fri Jul 25 08:49:06 PDT 2003


Kirk Strauser wrote:
> At 2003-07-25T06:06:01Z, Diomidis Spinellis <dds at aueb.gr> writes:
> > You still have the overhead of two nc instances copying data and context
> > switching.
> Forgive my ignorance, but is that significantly higher than two /bin/sh
> instances copying data and context switching?

When the shell connects two local processes with a pipe it just
redirects the output of the one and the input of the other to the two
ends of a pipe(2) IPC abstraction and leaves them to communicate with
each other simply wait(2)ing until they finish.  The shell does not
shuffle the data between the two processes.  The same can also be done
when connecting a local process with a remote process through a
socket(2); there is no need for an intermediary, and this is what I have
implemented.

Diomidis - http://www.spinellis.gr


More information about the freebsd-hackers mailing list