RFR: Update running count of ForkJoinPool when thread pinned [v3]
Alan Bateman
alanb at openjdk.java.net
Wed Dec 22 12:16:39 UTC 2021
On Wed, 22 Dec 2021 02:01:49 GMT, Miao Zheng <duke at openjdk.java.net> wrote:
> The problem of this PR is compensated threads may not be used when RC of FJP greater than -Djdk.defaultScheduler.parallelism while pin happens.
The behaviour you observe is expected. You've set parallelism to 1. It increases temporarily because one of the virtual threads invokes code that does a managed block. It then decreases back to 1 when that is done. I think what you are asking is to re-visit the question as to whether pinning should increase parallelism. Ron argued in the other PR that it should not on the grounds that if you are dependent on that then the system will eventually wedge anyway. For cases like this it would be better to change the code to eliminate the pinning, we hope this is temporary until Java monitors are-implemented.
-------------
PR: https://git.openjdk.java.net/loom/pull/83
More information about the loom-dev
mailing list