On Sat, 3 Jun 2023 13:41:53 GMT, Alan Bateman <al...@openjdk.org> wrote:
> Virtual threads created directly with the Thread API are not included in the > new thread dump by default. This was a source of confusion in JDK 19/20 when > virtual threads were in preview. We have decided to switch the default so > that all virtual threads are observable. Future work will reduce/remove the > overhead of tracking threads in the root container. The change proposed here > has no impact to virtual threads created with the virtual > ThreadPerTaskExecutor or StructuredTaskScope. > > With jdk.trackAllThreads defaulting to true then the need for > SharedThreadContainer to count threads can go away, as does the need for > RootContainer::threads to return virtual threads blocked on I/O. > > Most of the changes are to the test HotSpotDiagnosticMXBean/DumpThreads.java > as this is expanded to cover more cases, and specifically more cases with > thread groupings that correspond to the ThreadPerTaskExecutor and thread > pools. > > Testing: Test1-5 Marked as reviewed by rpressler (Committer). ------------- PR Review: https://git.openjdk.org/jdk/pull/14300#pullrequestreview-1463085546