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 This pull request has now been integrated. Changeset: 2e9eff56 Author: Alan Bateman <al...@openjdk.org> URL: https://git.openjdk.org/jdk/commit/2e9eff56418273e85accc43dcef533995c6be8bf Stats: 319 lines in 6 files changed: 183 ins; 81 del; 55 mod 8309406: Change jdk.trackAllThreads to default to true Reviewed-by: rpressler, mchung, cjplummer ------------- PR: https://git.openjdk.org/jdk/pull/14300