Subject: Re: [Boost-bugs] [Boost C++ Libraries] #5516: Upgrade lock is not acquired when previous upgrade lock releases if another read lock is present
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-12-09 18:04:16
#5516: Upgrade lock is not acquired when previous upgrade lock releases if another
read lock is present
------------------------------------+---------------------------------------
Reporter: fred@⦠| Owner: viboes
Type: Support Requests | Status: assigned
Milestone: To Be Determined | Component: thread
Version: Boost 1.42.0 | Severity: Problem
Resolution: | Keywords:
------------------------------------+---------------------------------------
Comment (by viboes):
Coming back to you example
m1 - Trying to take an shared lock
m1 - Took a shared lock
m2 - Trying to take an upgradable lock
m2 - Took an upgradable lock
m3 - Trying to take an upgradable lock
m2 - Released an upgradable lock
m3 - Took an upgradable lock
m3 - Releasing locks
m1 - Released the lock
Whether these sequence appear before or after in the trace are irrelevant.
m3 - Took an upgradable lock
m3 - Releasing locks
m1 - Released the lock
It is up to the scheduler to execute m1 or m3, as both are active threads,
no one is blocking for the other. Note that m1 had already a shared lock,
so it can continue to be executed independently of whether m3 takes the
upgrade lock.
The following sequence could also be possible
m3 - Took an upgradable lock
m1 - Released the lock
m3 - Releasing locks
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/5516#comment:6> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:08 UTC