RFR: 8291429: java/lang/Thread/virtual/ThreadAPI.java timed out on single core system [v2]
Serguei Spitsyn
sspitsyn at openjdk.org
Thu Oct 6 14:31:09 UTC 2022
On Thu, 6 Oct 2022 13:39:25 GMT, Alan Bateman <alanb at openjdk.org> wrote:
>> This is a test only change for two tests for virtual threads that hang/timeout on single core systems. The two tests involve pinning and require at least two carrier threads. The test lib used by these tests is updated to define a new method that ensures parallelism is at least a given value and both tests are updated to use this. There are a number of tests in the debugger area that may potentially use this in the future.
>
> Alan Bateman has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains four additional commits since the last revision:
>
> - Replace try-with-resource with try-finally
> - Merge
> - Make close idempotent
> - Initial commit
The update looks more clear.
Thanks,
Serguei
test/jdk/java/lang/Thread/virtual/ThreadAPI.java line 790:
> 788: VThreadRunner.setParallelism(previousParallelism);
> 789: }
> 790: }
Just a side note to be aware about a potential problem.
This won't work correctly if there are more than one such tests executed in VM at the same time.
Then there can be a race to restore the parallelism value.
But it seems is not the case.
-------------
Marked as reviewed by sspitsyn (Reviewer).
PR: https://git.openjdk.org/jdk/pull/10562
More information about the serviceability-dev
mailing list