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

David Holmes dholmes at openjdk.org
Wed Aug 24 23:57:31 UTC 2022


On Wed, 24 Aug 2022 14:23:49 GMT, Johan Sjölén <duke at openjdk.org> wrote:

>> May I please have a review for this PR which implements a `MRWMutex` class for Hotspot?
>> 
>> This PR does 3 things:
>> 
>> * Adds a port of ZGC's MRSW mutex (see [0]) to Hotspot
>> * Adds some new utilities for writing multi-threaded tests.
>> * Adds some tests for MRSW Mutex using these new utilities
>> 
>> The ticket has some comments which might be worth checking out: https://bugs.openjdk.org/browse/JDK-8291714
>> 
>> [0] Original source code here: https://github.com/openjdk/zgc/blob/zgc_generational/src/hotspot/share/gc/z/zJNICritical.cpp
>
> Johan Sjölén has updated the pull request incrementally with two additional commits since the last revision:
> 
>  - Update documentation
>  - Fix outdated headers and remove dead code

As a stand-alone RWL implementation with the described properties and limitations this seems okay to me.

Whether this RWL implementation will turn out to be useful for any existing subsystems without exhibiting performance pathologies or bad interactions with existing synchronization code is just something we will have to see. However, as we tend not to encourage unused code it would perhaps be better to delay integration of this until there is an actual usecase ready for it.

Thanks.

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

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


More information about the hotspot-runtime-dev mailing list