RFR: 8366038: Thread::SpinRelease should use Atomic::release_store [v2]

Kim Barrett kbarrett at openjdk.org
Tue Sep 2 14:37:43 UTC 2025


On Tue, 2 Sep 2025 08:08:30 GMT, Anton Artemov <duke at openjdk.org> wrote:

>> Hi, please consider the following changes:
>> 
>> `Thread::SpinRelease()` uses an `OrderAccess::fence()` to prevent loads and stores from within the critical section to float down out of the section. A full fence is expensive and it is an overkill on most platforms. Instead, one can achieve the same effect with `Atomic::release_store()`. 
>> 
>> Tested in tiers 1 - 3.
>
> Anton Artemov has updated the pull request incrementally with two additional commits since the last revision:
> 
>  - Update src/hotspot/share/runtime/thread.cpp
>    
>    8366038: Updated comments.
>    
>    Co-authored-by: David Holmes <62092539+dholmes-ora at users.noreply.github.com>
>  - Update src/hotspot/share/runtime/thread.cpp
>    
>    8366038: Updated comments.
>    
>    Co-authored-by: David Holmes <62092539+dholmes-ora at users.noreply.github.com>

> Thanks for reviews, let's /integrate

OpenJDK changes (not just HotSpot changes) should generally be open for 24 hours before being integrated.
https://openjdk.org/guide/ > Life of a PR > 7. Allow enough time for review

-------------

PR Comment: https://git.openjdk.org/jdk/pull/27035#issuecomment-3245624272


More information about the hotspot-runtime-dev mailing list