From: Abhinav Saxena Date: 2009-09-14T18:04:27+09:00 Subject: Re: Global Mutex? --000e0cd32e1e7d46c6047385f3bf Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Thanks Brian. I have never used flock and in fact, didn't know that they ca= n handle this problem. Thanks, Abhinav -- =E0=A4=85=E0=A4=AD=E0=A4=BF=E0=A4=A8=E0=A4=B5 http://twitter.com/abhinav On Mon, Sep 14, 2009 at 2:22 PM, Brian Candler wrote: > Abhinav Saxena wrote: > > I used something like this using "ln -s" system command. Used to work > > great, > > so if you want a simple approach and implementation you can use it. One > > catch: if the process which has the lock dies in between, you will have > > to > > ensure locks are properly released. > > Both versions I proposed don't suffer from this problem. > > - if you flock a file, the lock is dropped when the process owning it > dies > > - if you synchronize using 'yield' within a DRb server, then if the > client dies the TCP connection will be dropped and the block will > terminate. > > -- > Posted via http://www.ruby-forum.com/. > > --000e0cd32e1e7d46c6047385f3bf--