RFR: 8321242: Enable WorkerThreads to run tasks in caller thread [v2]
Stefan Karlsson
stefank at openjdk.org
Wed Dec 6 08:37:35 UTC 2023
On Tue, 5 Dec 2023 10:01:28 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:
>> src/hotspot/share/gc/shared/workerThread.cpp line 49:
>>
>>> 47: // No workers are allowed to read the state variables until they have been signaled.
>>> 48: _task = task;
>>> 49: _not_finished = num_worker_tasks;
>>
>> [preexisting] The assignment of _not_finished should be done with an Atomic::store.
>
> Amended.
Why should this be using Atomic::store? Concurrent accesses are guarded by the semaphores. That's what the comment tries to convene:
// No workers are allowed to read the state variables until they have been signaled.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/16945#discussion_r1416919541
More information about the hotspot-gc-dev
mailing list