RFR: 8291714: Implement a Multi-Reader Single-Writer mutex for Hotspot

Kim Barrett kbarrett at openjdk.org
Thu Aug 18 14:40:10 UTC 2022


On Wed, 17 Aug 2022 13:11:54 GMT, Johan Sjölén <duke at openjdk.org> wrote:

> > How does it compare with, for example, Terekhov's algorithm?
> 
> I'm not familiar with this algorithm, do you have a link?

One place I found it.
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2406.html#shared_mutex
search for "shared_mutex Reference Implementation"

What's proposed by this change has some similarities.  This moves some state manipulation out from under the lock by using atomic operations on the state. It only has one condvar, possibly  due to the limitations of our portability layer.  Terekhov's algorithm is fair in the sense that neither readers nor writers get preferential treatment; it defers to the OS to decide scheduling.

-------------

PR: https://git.openjdk.org/jdk/pull/9838


More information about the hotspot-runtime-dev mailing list