From: Francis Cianfrocca Date: 2006-10-25T06:32:06+09:00 Subject: Re: File#flock as a cross-process mutex ------=_Part_10174_3953615.1161725486467 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 10/24/06, ara.t.howard@noaa.gov wrote: > > On Wed, 25 Oct 2006, Francis Cianfrocca wrote: > > > Has anyone wrapped up File#flock so it can used as a > platform-independent > > cross-process mutex? (I'm getting tired of writing the same code into > every > > app I do.) Or does anyone have a better idea? > > can you elaborate? do you need to yield the resource and re-aquire it? Most of the time I want to make sure only one process is running in a particular directory at a time. And if another one tries to start up, it should get an exception. And I also want it to be completely behaved in the presence of both hangs and crashes. Sometimes I do need to yield and re-acquire, but I'm not looking for condition variables, just mutual exclusion. ------=_Part_10174_3953615.1161725486467--