RFR: 8320318: ObjectMonitor Responsible thread [v4]
David Holmes
dholmes at openjdk.org
Sun Sep 29 07:23:39 UTC 2024
On Sun, 29 Sep 2024 07:17:32 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> I see where it came from in the aarch64 code, and that code does a stlr() to satisfy the JMM. It's fine. Leave it.
>
> To get the correct semantics for the JMM the releasing of a monitor has to have release semantics (funny that!). So setting the owner to null should be a release_store. On some platforms we get "release" semantics for free.
>
> The fence is needed for correct operation of our own locking implementation and has nothing to do with JMM.
But I concede that the comment is less clear on platforms where the release does not appear in the instruction stream. But I think it important that the need for release semantics be documented.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/19454#discussion_r1779942129
More information about the hotspot-dev
mailing list