List All Virtual Threads in a JVM
Nathan Reynolds
numeralnathan at gmail.com
Wed Oct 23 11:15:43 UTC 2024
How do I list all the virtual threads in a JVM?
ThreadMXBean.dumpAllThreads(), ThreadMXBean.getAllThreadIds(),
ThreadGroup.enumerate(), and Thread.getAllStackTraces() do not return
virtual threads. See my question at
https://stackoverflow.com/questions/79110874/list-the-virtual-threads-in-java
.
I can see how these APIs would not scale for virtual threads. What are the
thoughts for an API to list all the virtual threads? For an in-process
API, would an API that returns Stream<Thread> scale? I am not sure how an
MXBean API can stream Threads to make it scale.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/loom-dev/attachments/20241023/4f658d59/attachment.htm>
More information about the loom-dev
mailing list