From: "Iñaki Baz Castillo" Date: 2010-01-08T07:17:04+09:00 Subject: Re: Non-blocking communication between Ruby processes El Jueves, 7 de Enero de 2010, Iñaki Baz Castillo escribió: > El Jueves, 7 de Enero de 2010, Eric Wong escribió: > > Iñaki Baz Castillo wrote: > > > El Jueves, 7 de Enero de 2010, Eric Wong escribió: > > > > If you only talk between processes on one machine (since you're > > > > trying FIFOs), you can also check out the "posix_mq" gem/library I > > > > started recently: > > > > > > > > http://bogomips.org/ruby_posix_mq/ > > > > > > Really interesting. Is it safe to have various processes (Unicorn > > > workers) writting to a single posix_mq? or will the data be "mixed"? is > > > there any way to perform "atomic" writting operation in this queue? > > > > These queues are completely atomic at the message level and descriptors > > can be safely shared between processes/threads. SysV message queues > > weren't thread-safe, but POSIX ones are. > > Great! I've already tested it :) I've also realized that in case two processes perform "receive" for the same mq then the messages received are distributed at 50% (one message for each receiver). :) -- Iñaki Baz Castillo