Newsgroups: comp.unix.internals Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!sdd.hp.com!elroy.jpl.nasa.gov!decwrl!pa.dec.com!decprl!decprl!boyd From: boyd@prl.dec.com (Boyd Roberts) Subject: Re: Regular pipe vs. Named Pipe Message-ID: <1991Jun10.093433.16241@prl.dec.com> Sender: news@prl.dec.com (USENET News System) Nntp-Posting-Host: prl313.prl.dec.com Reply-To: boyd@prl.dec.com (Boyd Roberts) Organization: Digital Equipment Corporation - Paris Research Laboratory References: <1991Jun7.195953.27744@digi.lonestar.org> Date: Mon, 10 Jun 91 09:34:33 GMT In article <1991Jun7.195953.27744@digi.lonestar.org>, cfoughty@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@prl.dec.com ``When the going gets wierd, the weird turn pro...''