1. Enumerate all threads

  2. Thread groups

  3. Thread start/end events

  4. Test if a thread is a virtual thread

  5. Features not implements for virtual threads:


Debuggers and tools using the Java Debug Interface API observe the following differences:

  1. com.sun.jdi.VirtualMachine::allThreads enumerates platform threads only, the list does not include mirrors for virtual threads.
  2. Virtual threads are not live threads in a thread group so ThreadGroupReference::threads only lists platform threads.
  3. ThreadStartRequest/ThreadDeathRequest request notifications of thread start/termination of platform threads by default. Tools have to opt-in to get start/death events for virtual threads (by invoking the removeVirtualThreadFilter method on the event request.

As a temporary measure to support existing IDEs/debugger releases, the JDWP agent tracks virtual threads so that VirtualMachine::allThreads and ThreadGroupReference::threads will enumerate virtual threads. This is not a scalable solution and highly unsuited to environments where a debugger is attached to a running VM.