[crac] RFR: Resize ForkJoinPool and some concurrent data structures

Radim Vansa duke at openjdk.org
Thu Mar 23 17:41:38 UTC 2023


On Thu, 23 Mar 2023 17:32:18 GMT, Dan Heidinga <heidinga at openjdk.org> wrote:

>> Some parts of JDK expect that #cpus is constant; update those places after restore.
>
> @rvansa This was discussed on the list back in May 2022 [0] and it was noted that Doug Lea updated FJP to support changing the number of threads using a new ::setParallelism(int) [1] method.  Is this patch a backport of that work?
> 
> Backporting the FJP changes to the CRaC branch and basing our updates on the ::setParallelism method will provide the best continuity to users as they move to using CRaC on newer releases.
> 
> [0] https://mail.openjdk.org/pipermail/crac-dev/2022-May/000229.html
> [1] https://github.com/openjdk/crac/blob/f235955eefb1141a2e72116dfcf345e40416f059/src/java.base/share/classes/java/util/concurrent/ForkJoinPool.java#L2938

@DanHeidinga No, this is my original work. I went through the changes in more recent JDK and those changes were far from trivial, therefore a backport would not be straightforward. If CRaC is rebased on a more recent JDK we should scratch these changes and use the `setParallelism` instead; this PR intends to provide a minimalistic solution in JDK 17.

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

PR Comment: https://git.openjdk.org/crac/pull/54#issuecomment-1481613726


More information about the crac-dev mailing list