From: "Iñaki Baz Castillo" Date: 2010-01-11T01:17:32+09:00 Subject: Re: Non-blocking communication between Ruby processes El Domingo, 10 de Enero de 2010, Gary Wright escribió: > On Jan 9, 2010, at 12:54 PM, Iñaki Baz Castillo wrote: > > Posix message queues are just 20-40% slower than pipes in my benchmarks > > (but pipes are no multiprocess/thread safe). > > I believe pipes can be used concurrently if reads and writes are less than > or equal to PIPE_BUF bytes. Is the size limitation the problem you were > hinting at or something else? Yes, pipes allow atomic operation but just in case the message is less than 4 or 8 bytes, no more. In C it can be useful if you pass a pointer via pipe. I tested it (in ruby) by sending strings of 10 bytes size from various processes to a shared pipe. The reader gets the strings mixed :) However this doesn't occur with posix message queues. Regards. -- Iñaki Baz Castillo