RFR: 8291714: Implement a Multi-Reader Single-Writer mutex for Hotspot
Johan Sjölén
duke at openjdk.org
Fri Aug 19 08:41:31 UTC 2022
On Thu, 18 Aug 2022 14:36:56 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:
>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.
Yeah, these are very similar solutions, seems like the major difference is the granularity of information provided by a condvar, locking instead of using atomics, and bit twiddling instead of just using the sign of a signed number.
-------------
PR: https://git.openjdk.org/jdk/pull/9838
More information about the hotspot-runtime-dev
mailing list