Boost::interprocess::scoped_lock application crash inside lock?

That's seems perfectly logic to me :) As your application crash, the mutex which maps to your OS interprocess communication mechanism (IPC) is not released. When your application restart it tries to get the mutex without success! I suppose your application has different subsystems (processes) that need to be synchronized.

You have to devise a global policy in case of a crash of one of your subsystem to manage correctly the lock. For example, if one of your subsystem crash, it should try and unlock the mutex at startup. It can be tricky as other subsystems use that lock.

Timeouts can help too. In any case, you have to devise the policy having in mind that any of your processes can crash while having locked the mutex... By the way, you can manually delete IPC before application restart (to test / debug) with command like 'ipcs/ipcrm' (on unixes). Of course, if you do not need interprocess locking, use simple scoped locks :) my2c.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions