No, what I'm after is that we check if the PID still exists (i.e. the process is still running), and if it doesnt we then know that the holder has crashed, and we can take possession of the lock. Zeljko Vrba wrote:
On Tue, Nov 27, 2007 at 08:25:27PM +0100, Lars Hagström wrote:
Hmm, I've been thinking about this a little bit more, and I've more and more started to like the idea (not for its beauty, but more for its practicality)...
I think this approach is a bad idea. Even if the application itself does not hold the mutex for a long time (measured in CPU time), it may be preempted and/or stopped for arbitrary amounts of time (eg. think swapping). If this happens after it has acquired a mutex, then this scheme will break.
Lars Hagström wrote:
Of course this assumes that locks are never held for "a long time", and is quite easily considered a horrible solution... But it may well work in many situations.
Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users