There are a few nsk debugger tests that pin multiple virtual threads to carrier 
threads when synchronizing. Sometime the default number of carrier threads 
(which equals the number of CPUs) is not enough, and the test deadlocks because 
virtual threads start to wait forever for an available carrier thread. This PR 
fixes this problem by using the `jdk.virtualThreadScheduler.parallelism` 
property to change the default number of carrier threads. I believe the largest 
number of carrier threads any test needs is 11, so I chose 15 just to be safe.

I had initially tried to fix each individual test by using the test support in 
`VThreadRunner.setParallism()`. The advantage of this was limiting the scope of 
the change to just a few tests, and also being able to specify the exact number 
of needed carrier threads. The disadvantage was having to make quite a few 
changes to quite a few tests, plus I had one troublesome test that was still 
failing, I believe because I didn't fully understand how many carrier threads 
it needed. Just giving every test 15 carrier threads in the end was a lot 
easier.

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

Commit messages:
 - Update problem list for fixed tests.
 - Use -Djdk.virtualThreadScheduler.parallelism=15 so we always have enough 
carrier threads if the test pins a lot of threads.

Changes: https://git.openjdk.org/jdk/pull/11735/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=11735&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8285416
  Stats: 25 lines in 3 files changed: 2 ins; 23 del; 0 mod
  Patch: https://git.openjdk.org/jdk/pull/11735.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/11735/head:pull/11735

PR: https://git.openjdk.org/jdk/pull/11735

Reply via email to