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

David Holmes dholmes at openjdk.org
Tue Sep 2 12:31:42 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>

Marked as reviewed by dholmes (Reviewer).

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

PR Review: https://git.openjdk.org/jdk/pull/27035#pullrequestreview-3176327861


More information about the hotspot-runtime-dev mailing list