RFR: 8321242: Enable WorkerThreads to run tasks in caller thread [v2]
Aleksey Shipilev
shade at openjdk.org
Wed Dec 6 08:56:35 UTC 2023
On Wed, 6 Dec 2023 08:42:50 GMT, Axel Boldt-Christmas <aboldtch at openjdk.org> wrote:
> However I question having this logic be tied to `coordinator_distribute_task`. In all places we see this pattern the `can_do_parallel()` check guards against `workers == nullptr`. This would not go away with this patch.
I think the fallbacks for `workers == nullptr` serve another purpose: either we are in bootstrapping when workers are not yet available, or the caller did not supply us with the worker threads at all. I.e. we need a single-threaded fallback for non-worker-pool cases to _work_. Ultimately, I think most of the code should assume the worker pool normally exists, and that is how we simplify the code.
This PR is about optimizing what happens if we _do_ have worker pool, and still decide to run things in caller for _performance_ reasons. I would avoid conflating the two use cases.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/16945#issuecomment-1842448637
More information about the hotspot-gc-dev
mailing list