RFR: 8321242: Enable WorkerThreads to run tasks in caller thread

Aleksey Shipilev shade at openjdk.org
Tue Dec 5 09:44:34 UTC 2023


On Tue, 5 Dec 2023 09:22:26 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

>> src/hotspot/share/gc/shared/workerThread.cpp line 63:
>> 
>>> 61:   if (use_caller) {
>>> 62:     // Execute task in caller.
>>> 63:     task->work(0);
>> 
>> The worker threads do this in the context of a GCIdMark.  Seems like that should be done here too.
>
> Oh, right, added.

After looking inside `GCIdMark`, I think this effectively limits callers to `NamedThreads`. Which means the only callers might be either worker threads (unlikely recursive invocation), `VMThread` and `ConcurrentGCThread`-s. It is probably fine, as most of the parallel work is called from there.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/16945#discussion_r1415248841


More information about the hotspot-gc-dev mailing list