Boost logo

Boost :

Subject: Re: [boost] Portable robust mutex an another try...
From: Niall Douglas (s_sourceforge_at_[hidden])
Date: 2014-07-16 20:00:47


On 15 Jul 2014 at 17:42, Ladislav Sopko wrote:

> I did try to continue with */Ion Gaztanaga's /*idea of portable robust
> mutex.
> I post my code and considerations in codereview.
>
> http://codereview.stackexchange.com/questions/57083/portable-c-boostiterprocessmutex-an-another-try

I've implemented this a few times, and I always did it by having the
locker write the current time and the pid at the point of lock. If
too much time elapses and it doesn't unlock, you can check the pid or
simply force an unlock.

It's certainly much lighter weight than use file locks. Those are
slow and not portable.

Niall

-- 
ned Productions Limited Consulting
http://www.nedproductions.biz/ 
http://ie.linkedin.com/in/nialldouglas/



Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk