RFR: 8340796: Use a consistent order when loading cxq and EntryList [v2]
Dean Long
dlong at openjdk.org
Thu Oct 24 20:32:07 UTC 2024
On Thu, 24 Oct 2024 15:28:37 GMT, Fredrik Bredberg <fbredberg at openjdk.org> wrote:
>> Made sure we use a consistent order when reading ObjectMonitor EntryList and cxq while exiting the monitor.
>> That consistent order is EntryList before cxq. Added a comment in the shared code to explaining why it's okay that waiters slip undetected between reading EntryList and cxq.
>>
>> Tested ok tier1-3.
>
> Fredrik Bredberg has updated the pull request incrementally with one additional commit since the last revision:
>
> Update after review
If reading cxq first avoids the benign "race", then why not make that the preferred ordering convention?
It sounds like we are not too concerned about avoiding this particular protocol state (if we aren't calling it a race), but if we were, there are platform-specific things we could try. For example, some platforms should be able to read both fields at the same time if the fields are adjacent in memory and suitably aligned.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/21584#issuecomment-2436281358
More information about the hotspot-dev
mailing list