RFR: 8306034: add support of virtual threads to JVMTI StopThread [v3]

Serguei Spitsyn sspitsyn at openjdk.org
Sat Apr 22 00:12:50 UTC 2023


On Fri, 21 Apr 2023 18:58:22 GMT, Chris Plummer <cjplummer at openjdk.org> wrote:

>> Do you ask this question to check if we want to extend this test to provide coverage for platform threads as well?
>> 
>> The support of platform threads is much simpler. The JVMTI `StopThread` never returns the `THREAD_NOT_SUSPENDED` and `OPAQUE_FRAME` error codes for platform threads. So that this kind of testing is not needed for platform threads.
>
> For the JDI tests I added, I execute them in both modes, with the appropriate adjustments to account for the errors we except for virtual threads. We should be testing to make sure that StopThread works with platform threads under a variety of situations.

Extending this test to cover platform threads does not look natural and is going to be a little ugly.
But I can extend it to provide coverage for BoundVirtualThread case
which is highjacking the platform thread implementation.
Would it help?
We should have pretty good coverage of the JVMTI `StopThread` for platform threads in `nsk.jvmti` test suite.
It includes:
  - `stopthrd006` and `stopthrd007`
  - a number of `scenarios/capability/CM01 `tests

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

PR Review Comment: https://git.openjdk.org/jdk/pull/13546#discussion_r1174232494


More information about the serviceability-dev mailing list