RFR: 8291714: Implement a Multi-Reader Single-Writer mutex for Hotspot [v2]
Kim Barrett
kbarrett at openjdk.org
Sat Aug 20 18:03:40 UTC 2022
On Fri, 19 Aug 2022 21:05:19 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> I don't now if your zlock is even a standard runtime/mutex, but let's definitely not have another version of lockers. I've never pushed back on blah_locked(). I need to see more evidence of why we need null mutex in the code (after the sweeper is removed), before I suggest a policy change.
>> I have a patch that removes the NULL ObjectLocker argument. I thought ObjectLocker was the only thing that took null until yesterday.
>
>> Alternatively, we could have two versions of lockers to appease both sides?
>
> "They who cannot remember the past are condemned to repeat it." :)
>
> We used to have `MutexLockerEx` that allowed the NULL whereas `MutexLocker` did not.
>
> I have no issues with the NULL case as it is cleaner that defining locked and unlocked code paths.
MutexLockerEx did two things - allow a nullptr for the mutex argument, and
allow locking without a safepoint check. The vast majority of uses were for
the latter. Both of those got merged into MutexLocker. (The old MutexLocker
was deleted and MutexLockerEx was renamed to MutexLocker, with uses updated.)
Perhaps only the safepoint check control should have been added to
MutexLocker.
-------------
PR: https://git.openjdk.org/jdk/pull/9838
More information about the hotspot-runtime-dev
mailing list