RFR: 8321242: Enable WorkerThreads to run tasks in caller thread [v2]

Aleksey Shipilev shade at openjdk.org
Wed Dec 6 08:46:36 UTC 2023


On Wed, 6 Dec 2023 08:34:53 GMT, Stefan Karlsson <stefank at openjdk.org> wrote:

>> 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.

I would say it is a matter of hygiene. If we access things with Atomics, e.g. for CASes, then we should be doing atomic accesses everywhere else. In case some platforms do something specific for atomics to work. There is a CAS for `_not_finished` in `WorkerTaskDispatcher::worker_run_task`. I guess we want the same for `_started`.

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

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


More information about the hotspot-gc-dev mailing list