RFR: 8364819: Post-integration cleanups for JDK-8359820 [v8]

Anton Artemov duke at openjdk.org
Wed Aug 20 07:04:44 UTC 2025


On Sun, 17 Aug 2025 21:34:05 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> Anton Artemov has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   8364819: Added atomic loads to getters
>
> Our convention for lock-free code is that we should use `Atomic::load` and `Atomic::store` for all accesses to the shared variable. - this serves as clear documentation of the lock-free nature of the code. The use, or not,  of `volatile` on the declaration of the shared variable is not a convention we have firmly established or documented. I am in the camp that the `volatile` should not be present on the declaration as we have internalised/encapsulated the `volatile` within the `Atomic` functions.
> 
> @albertnetymk suggestion to use explicit `release`  between the store and the `pthread_kill` does also address the visibility concern unlike the earlier `release_store` suggestion which puts the `release` in the wrong place. On further reflection my suggestion about the `fence` should also make the `fence` explicit between the store and the `pthread_kill` rather than being inside the setter method (which again by our own conventions should be renamed to have `fence` in the name if we did that).
> 
> Arguably, as stated much much earlier, we don't need any explicit memory ordering here in practice as the signal implementation must provide its own ordering guarantees to actually function - and there is no way a compiler would ever re-order the store with the `pthread_kill` call!

Thanks @dholmes-ora

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

PR Comment: https://git.openjdk.org/jdk/pull/26656#issuecomment-3204460815


More information about the hotspot-dev mailing list