-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider using native std::sync primitives instead of parking_lot #126
Comments
Sure. We can use the stress tool to benchmark this. |
I have tried to migrate to |
I have made some improvements by replacing upgreadable lock by a read lock that is then released into a write lock. I have not checked yet if this translation is always valid. The code is here: f72ff20 Sadly there is still some performance regression. With
And with std::sync::
|
In general it is not. As soon as the lock is released other waiting thread may gain access and do modifications. Upgradable lock guarantees that the upgrade is done with no intermediate modification. Upgradable locks are also exclusive wrt other upgradable locks, but not read locks. Even though with the way thing setup in paritydb this could be fine (e.g. we only expect It seems we're stuck with parking_lot for now. |
Now that
Mutex
is implemented in std without boxing whenfutex
is available, it might make sense to use them instead of parking_lot. There are some benchmarks hinting about better std performances.It might also make testing using e.g. loom easier.
Is it worth a trial and a benchmark?
The text was updated successfully, but these errors were encountered: