From: Robert Klemme Date: 2009-08-27T17:19:47+09:00 Subject: Re: Global Mutex? 2009/8/26 Brian Candler : > Aryk Grosz wrote: >> Is there any thing in ruby that acts as a global mutex? > > Between multiple processes on the same machine: I'd suggest using > File#flock on a local file (this probably won't work over NFS) with > File::LOCK_EX. You can include File::LOCK_NB if you want to test the > lock but not block if someone else has it. > > Between multiple processes on multiple machines: probably run a DRb > server one one machine which has a local mutex and yields back to the > caller. Aryk, just keep in mind that you are also potentially creating a global bottleneck at the same time... ;-) Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/