Regular pipe vs. Named Pipe

Boyd Roberts boyd at prl.dec.com
Mon Jun 10 19:34:33 AEST 1991


In article <1991Jun7.195953.27744 at digi.lonestar.org>, cfoughty at digi.lonestar.org (Cy Foughty) writes:
> 	Which is faster, a named pipe or a message queue?
> 

Are, therein lies a tale.  A few years back I was asked this question
for vanilla System V.2.2 and found some interesting things about
message queues (gag).

In the benchmark it turned out that pipes used more CPU time, but got that
amount of CPU in (about) the same amount of real time.  Whereas message queues
took less CPU time, but _the real time was double the CPU time_.

Clearly the pipe was faster, but more CPU intensive.  But, I was worried
about why the message queues took so much real time.  So, after reading the
source I realised that the boneheads who'd implemented messages queues
only woke up queue readers _every once in a while_.  Hence the anomalous
amount of real time.

Readers weren't woken up when the data was ready, but at some later time!

Moral: System V IPC sucks.  Use pipes.  The file-system is your friend.


Boyd Roberts			boyd at prl.dec.com

``When the going gets wierd, the weird turn pro...''





More information about the Comp.unix.internals mailing list