Regular pipe vs. Named Pipe

Greg A. Woods woods at eci386.uucp
Fri Jun 14 04:47:37 AEST 1991


brnstnd at kramden.acf.nyu.edu (Dan Bernstein) writes:
> In article <2736 at root44.co.uk> gwc at root.co.uk (Geoff Clare) writes:
> > brnstnd at kramden.acf.nyu.edu (Dan Bernstein) writes:
> > >Basically, pipes work the same way everywhere, and named pipes don't.
> > >The name part of named pipes is their least portable aspect. Never use
> > >them in a long-lived program if you can use any other communications
> > >mechanism.
> >
> > Apart from the fact that Dan obviously didn't mean what he wrote here
> > ("any other communications mechanism" would include a mechanism specific
> > to one system, and therefore totally non-portable),
> 
> I meant what I wrote. A program which supports message queues and
> UNIX-domain sockets will work correctly on far more machines than a
> program which supports named pipes. In fact, a program which does
> anything with named pipes that couldn't be done with pipes is almost
> certainly going to fail on one of (A) SunOS; (B) Ultrix; (C) SVR4.

GRRR!  You should really read some market data Dan.  There are
probably several million more "machines" out there running with Named
Pipes and no Sockets than there are the other way 'round.

As others have said, they were in UNIX (i.e. the trademarked one from
AT&T) since a long time ago, and work more portably on any versions of
UNIX derived from the "real" AT&T version than any other IPC mechanism
available on the same machines.  You can blame whoever you want for
not keeping BSD UNIX in line with AT&T's versions.  They seem to have
split the tree quite early, and not only were they not interested in
updating their license, but were not even interested in matching their
functionality, if only for portability reasons....  On the other hand,
AT&T have endeavored to include some of the more coherent features of
BSD in current releases, even if they did go a bit over-board with r4!

As for the future, "real" UNIX will have Named Pipes for quite some
time, only they call them FIFO's now.  In case you missed it, please
see mkfifo(1m) and mkfifo(3c) in the SysVr4 documentation.  According
to read(2) from the same documentation, FIFO's have *exactly* the same
semantics as pipes created by pipe(2), as I believe they "always" have.
-- 
							Greg A. Woods
woods@{eci386,gate,robohack,ontmoh,tmsoft}.UUCP		ECI and UniForum Canada
+1-416-443-1734 [h]  +1-416-595-5425 [w]  VE3TCP	Toronto, Ontario CANADA
Political speech and writing are largely the defense of the indefensible-ORWELL



More information about the Comp.unix.internals mailing list