RFR: 8367848: Parallel: Use NMethodToOopClosure during Young GC [v2]

Stefan Karlsson stefank at openjdk.org
Wed Sep 17 19:32:20 UTC 2025


On Wed, 17 Sep 2025 15:51:59 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:

>> src/hotspot/share/gc/parallel/psScavenge.cpp line 237:
>> 
>>> 235: 
>>> 236: class ScavengeRootsTask : public WorkerTask {
>>> 237:   Threads::ThreadsClaimTokenScope _threads_claim_token_scope; // needed for Threads::possibly_parallel_threads_do
>> 
>> I wonder if this class could just be named ClaimTokenScope so that we don't need to see the word Threads twice?
>> 
>> Threads::ThreadsClaimTokenScope
>> 
>> vs
>> 
>> Threads::ClaimTokenScope
>> 
>> OTOH, the function is named `change_thread_claim_token`. Maybe the second reviewer could weigh in on this.
>
> `ThreadsClaimTokenScope` should only be used by GC code, so I can put it in GC-shared code instead of `threads`.

Well, Threads::change_thread_claim_token() are also only used by GC but it is still located in Threads. Another alternative could be to put ThreadsClaimTokenScope at the end of threads.hpp.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27336#discussion_r2356545085


More information about the hotspot-runtime-dev mailing list