upgrade_mutex's People
upgrade_mutex's Issues
Why there is no upgrade_lock< std::shared_lock<Mutex> >? Without time?
Why upgrade_lock
have no
upgrade_lock(std::shared_lock<mutex_type>&& sl)
constructor?
upgrade_mutex
does not have unlock_shared_and_lock_upgrade
, also. There is only timed version try_unlock_shared_and_lock_upgrade_for
/ try_unlock_shared_and_lock_upgrade_until
.
P.S. It seems that boost have these timeless versions...
Issues with upgrade_mutex
- a. I believe that upgrade_mutex::try_unlock_shared_and_lock_until() should wait on
gate1_
until there is no writer and no upgrader and then it should decrement the reader count and set thewrite_entered_
flag and then it should wait ongate2_
until there are no more readers. This prevents new readers from taking a shared or upgrade lock while this function is waiting to take the exclusive lock.
b. Also, right now since it is only waiting ongate2_
it won't get signaled after any of theunlock*()
functions are called. - I believe that upgrade_mutex::try_unlock_shared_and_lock_upgrade_until() should wait on
gate1_
instead ofgate2_
. Right now since it is only waiting ongate2_
it won't get signaled afterunlock_upgrade()
is called. - a. I believe that upgrade_mutex::try_unlock_upgrade_and_lock_until() should decrement the reader count and set the
write_entered_
flag and then it should wait ongate2_
until there are no more readers. This prevents new readers from taking a shared lock while this function is waiting to take the exclusive lock.
b. Also, right nowgate2_
only gets signaled when the reader count is zero but this function currently waits for the reader count to reach 1.
I've already fixed these issues in the copy of upgrade_mutex that exists in Boost.Thread: https://github.com/boostorg/thread/blob/develop/include/boost/thread/v2/shared_mutex.hpp.
Are these issues all valid or have I missed something? Thank you for taking a look at this.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.