RFR: 8375643: G1: Convert G1RegionMarkStatsCache to use Atomic<T>
Aleksey Shipilev
shade at openjdk.org
Tue Jan 20 11:27:12 UTC 2026
On Tue, 20 Jan 2026 10:37:05 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:
>> Actually, what _are_ the atomicity requirements here? Is this code supposed to be called on same region stats by multiple threads? Or is this single threaded?
>
> In this method there are no atomic requirements. It is only called by a single thread. The only atomic requirements is when merging it down to a global table using `evict()`. However since that method requires an `Atomic`, we need to use `load/store_relaxed()` here anyway.
>
> It took me some time too to understand that the code is correct too. Should I add some comments?
Well, maybe comment that this is a single-thread code, we do not need atomic RMW here.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/29303#discussion_r2707929787
More information about the hotspot-gc-dev
mailing list