RFR(S): 8248657: Windows: strengthening in ThreadCritical regarding memory model
David Holmes
david.holmes at oracle.com
Sat Jul 11 13:14:43 UTC 2020
Hi Ludovic,
Sorry but this fix seems specific to the Windows-Aarch64 port work and
as such should be fixed as part of that port when the JEP is approved
and targeted.
David
On 10/07/2020 8:19 am, Ludovic Henry wrote:
> Hello,
>
> This small fix is in the context of the larger support for Windows-AArch64. I am using Bernhard Urban's CR as I am currently not an author.
>
> ThreadCritical is used to synchronize the allocation of new Arena chunks. However, on platforms with weaker memory models than x86 (primarily ARM), the original ThreadCritical initialization code would be racy, leading to crashes. To fix that, we switch to initializing the ThreadCritical static data by using a functionally-sound Win32 API focused on initialization [1]. This approach also has the advantage of simplifying the code, and get it closer to how it is done on Linux.
>
> JBS: https://bugs.openjdk.java.net/browse/JDK-8248657
> Webrev: http://cr.openjdk.java.net/~burban/luhenry/8248657/webrev.00/
> Testing: jtreg:test/hotspot/jtreg:tier1, jtreg:test/jdk:tier1, jtreg:test/jdk:tier2, jtreg:test/langtools on Windows-x86_64, no regressions
>
> Thank you,
>
> --
> Ludovic
>
> [1] https://docs.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi-initonceinitialize
>
More information about the hotspot-runtime-dev
mailing list