RFR: 8376353: Parallel: Convert PSParallelCompact classes to use Atomic<T>

Thomas Schatzl tschatzl at openjdk.org
Mon Feb 9 21:26:17 UTC 2026


On Mon, 9 Feb 2026 09:43:14 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:

>> Hi all,
>> 
>>   please review this change to convert `PSParallelCompact` to use `Atomic<T>`.
>> 
>> Testing: tier1-5,gha
>> 
>> Thanks,
>>   Thomas
>
> src/hotspot/share/gc/parallel/psParallelCompact.cpp line 1401:
> 
>> 1399:     for (unsigned int i = PSParallelCompact::old_space_id; i < PSParallelCompact::last_space_id; ++i) {
>> 1400:       ::new (&_claim_counters[i]) Atomic<uint>{};
>> 1401:     }
> 
> I wonder with `8376810: Make Atomic<T> default constructor non-explicit` merged, if this loop is still needed.

I will clean up all these loops with [JDK-8377224](https://bugs.openjdk.org/browse/JDK-8377224) (probably split up a bit depending on e.g. gc) instead of fixing it in half of the places now.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/29425#discussion_r2783056303


More information about the hotspot-gc-dev mailing list