RFR: 8320318: ObjectMonitor Responsible thread [v4]
Coleen Phillimore
coleenp at openjdk.org
Wed Sep 25 19:45:44 UTC 2024
On Wed, 25 Sep 2024 19:36:38 GMT, Fredrik Bredberg <fbredberg at openjdk.org> wrote:
>> src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp line 474:
>>
>>> 472:
>>> 473: // Set owner to null.
>>> 474: // Release to satisfy the JMM
>>
>> This comment doesn't make sense to me. The JMM is the Java Memory Model, and this just releases the lock. The Java memory model implies memory ordering and optimizations. The next comment about fence is more meaningful. Did someone want this comment?
>
> Someone did want this comment in each of the cpu-specific files. I do like to use the same comment in all equal places, so I did what someone wanted. But having said that, CPUs are different. In some you need an explicit release-instruction (like a `membar` of some sort), and in others you don't. I do agree that in a cpu-specific file where it's not needed with an explicit release-instruction, this comment makes no (or less sense). What to do?
Whoever asked for it, let's see if this is what they wanted. I thought the fence() comment below it is what was requested. I agree the comment should be repeated on all platforms though for consistency.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/19454#discussion_r1775905867
More information about the hotspot-dev
mailing list