JDI VirtualThreads.allThreads (and JDWP VirtualMachine/AllThreads) continue to enumerate all platform threads.
Thread groups
Virtual threads are not active members of a thread group.
JDI ThreadGroupReference::threads (and JDWP ThreadGroupReference/Children) continue to enumerate all platform threads in the group.
removeVirtualThreadFilter that can be used to remove the filtering of thread start/end events for virtual threads. This may be changed so that JDI clients opt-out rather than opt-in for these events.
ThreadStartRequest/ThreadDeathRequest define a new methodNot Supported
The following are current not supported for virtual threads:
- JDI ThreadReference::stop / JDWP ThreadReference/Stop
- JDI ThreadReference::interrupt / JDWP ThreadReference/Interrupt
JDWP agent options (temporary)
Option Name and Value Description Default
--------------------- ----------- -------
trackvthreads=some|all track some or all vthreads some
enumeratevthreads=y|n thread lists include vthreads y
fakevthreadstartevent=y|n send fake start event when needed y
enumeratevthreads
control whether or not vthreads are included inVM.allThreads
andThreadGroupReference.children
.trackvthreads
determines what vthreads will be returned ifenumeratevthreads=y
, so it doesn’t carry any meaning to the user ifenumeratevthreads=n
, but will still impact with the debug agent does internallyfakevthreadstartevent
is independent of the two others. Ify
, then before sending an event, send a fake THREAD_START event for if the debugger hasn’t already been notified about the vthread the event occurred on. Intellij needs this. Note currently there is a bug, and iftrackvthreads=all
, no fake THREAD_START will ever be sent. This is only an issue if the debug agent is started after some vthreads have been created (a mode I haven’t even tested yet, and I don’t think is commonly used). (edited)