Boost logo

Boost Users :

Subject: [Boost-users] [Interprocess] Waiting thread termination causes deadlock
From: Markus Bonk (markus_bonk_at_[hidden])
Date: 2017-11-22 10:14:11


Hi,

I am having issues with boost::interprocess::ipcdetail::spin_condition::do_wait_timed deadlocking.

The issue occurs when a thread that is waiting due to a call to interprocess_condition_any::wait() terminates unexpectedly and interprocess_condition_any::notify_all() is called (from any process). The cause of the deadlock is not that the terminating thread held a lock – it doesn’t because it is waiting, but that spin_condition::m_num_waiters is never decremented to zero because one of the threads is no longer waiting and so the enter mutex is not freed.

I have tried BOOST_INTERPROCESS_ENABLE_TIMEOUT_WHEN_LOCKING, however as far as I can see this only tells me that the deadlock is there.

Are there any suggestions how I can recover from spin_condition not freeing the enter mutex? Or perhaps some way of avoiding the issue?

Markus



________________________________

Markus Bonk
Senior Software Engineer



[cid:image19ab5c.GIF_at_24a568cc.448b8dc0]





3Dconnexion GmbH
Clarita-Bernhard-Str. 18
81249 München
Germany

Tel: +49 (89) 897 45 42 - 70
Fax: +49 (89) 897 45 42 - 50

markus_bonk_at_[hidden]<mailto:markus_bonk_at_[hidden]>

www.3dconnexion.com<http://www.3dconnexion.com>









Geschäftsführer: Antonio Pascucci
Sitz der Gesellschaft: München
Registergericht: München HRB 99232






image19ab5c.GIF

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net