[Thread] shared_mutex problem
Hi all,
I'm experiencing a deadlock in the following code. After an timed out
call to boost::shared_mutex::timed_lock(),
boost::mutex::state.exclusive_waiting_blocked equals 1, which makes
further attempts to shared_lock the mutex block indefinitely.
Is this a bug, or are my expectations wrong?
Thanks,
Mark
#include
"Mark Westcott"
I'm experiencing a deadlock in the following code. After an timed out call to boost::shared_mutex::timed_lock(), boost::mutex::state.exclusive_waiting_blocked equals 1, which makes further attempts to shared_lock the mutex block indefinitely.
Well, they only block until all the threads currently holding shared_locks release their locks, but your test should work: if you can't get an exclusive lock, it should be OK to get a shared lock unless another thread is trying to get an exclusive lock.
Is this a bug, or are my expectations wrong?
It's a bug :-( Timeouts on locks are a pain to get right. I've filed it as issue #1905 on trac. Anthony -- Anthony Williams | Just Software Solutions Ltd Custom Software Development | http://www.justsoftwaresolutions.co.uk Registered in England, Company Number 5478976. Registered Office: 15 Carrallack Mews, St Just, Cornwall, TR19 7UL
"Mark Westcott"
Anthony Williams wrote:
"Mark Westcott"
writes: Is this a bug, or are my expectations wrong?
It's a bug :-( Timeouts on locks are a pain to get right.
I've filed it as issue #1905 on trac.
I'm sure. Thanks; I'll keep an eye on the ticket.
I've just checked in a fix on trunk. Anthony -- Anthony Williams | Just Software Solutions Ltd Custom Software Development | http://www.justsoftwaresolutions.co.uk Registered in England, Company Number 5478976. Registered Office: 15 Carrallack Mews, St Just, Cornwall, TR19 7UL
Anthony,
will we see it in 1.35.1 or I will need have to patch our local version
myself?
On Fri, 09 May 2008 01:51:06 -0600, Anthony Williams
"Mark Westcott"
writes: Anthony Williams wrote:
"Mark Westcott"
writes: Is this a bug, or are my expectations wrong?
It's a bug :-( Timeouts on locks are a pain to get right.
I've filed it as issue #1905 on trac.
I'm sure. Thanks; I'll keep an eye on the ticket.
I've just checked in a fix on trunk.
Anthony
"Andrey Tcherepanov"
will we see it in 1.35.1 or I will need have to patch our local version myself?
If there's a 1.35.1 release, I'll try to make sure all the bug fixes for boost.thread are there. Anthony -- Anthony Williams | Just Software Solutions Ltd Custom Software Development | http://www.justsoftwaresolutions.co.uk Registered in England, Company Number 5478976. Registered Office: 15 Carrallack Mews, St Just, Cornwall, TR19 7UL
Anthony Williams wrote:
If there's a 1.35.1 release, I'll try to make sure all the bug fixes for boost.thread are there.
There was talk at BoostCon'08 about a possible 1.35.1 release. I think the threading lib is one of the driving forces. Why don't you let everyone know when you think the thread lib is ready to go. KevinH -- Kevin Heifner heifner @ ociweb.com http://heifner.blogspot.com Object Computing, Inc. (OCI) www.ociweb.com
We will wait till 1.35.1 comes out. Meanwhile, if you feel that you
changes are safe and good (aka cycled through regression tests
successfully), can you port them into release branch?
Thank you very much,
Andrey
On Fri, 09 May 2008 10:18:09 -0600, Anthony Williams
"Andrey Tcherepanov"
writes: will we see it in 1.35.1 or I will need have to patch our local version myself?
If there's a 1.35.1 release, I'll try to make sure all the bug fixes for boost.thread are there.
Anthony
participants (4)
-
Andrey Tcherepanov
-
Anthony Williams
-
Kevin Heifner
-
Mark Westcott