• Home
    • View
    • Login
    This page
    • Normal
    • Export PDF
    • Page Information

    Loading...
  1. Dashboard
  2. Undefined Space
  3. Loom
  4. Differences between platform and virtual threads

Page History

Versions Compared

Old Version 5

changes.mady.by.user Alan Bateman

Saved on Mar 09, 2021

compared with

New Version 6

changes.mady.by.user Alan Bateman

Saved on Mar 15, 2021

  • Previous Change: Difference between versions 4 and 5
  • Next Change: Difference between versions 6 and 7
  • View Page History

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Virtual threads always report their priority as NORM_PRIORITY. The priority is not inherited and cannot be changed with the setPriority method.
  • Virtual threads are daemon threads. Their daemon status cannot be changed with the setDaemon method.
  • Virtual threads cannot be suspended, resumed or stopped with the Thread suspend, resume and stop APIs.
  • Virtual threads have no permissions when running with a security manager.
  • Virtual threads are not active threads in a thread group. All virtual threads are in the same thread group, the group cannot be selected when creating a virtual thread. The ThreadGroup enumerate methods do not enumerate the virtual threads in the group.

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.

Overview
Content Tools
ThemeBuilder

Terms of Use
• License: GPLv2
• Privacy • Trademarks • Contact Us

Powered by a free Atlassian Confluence Open Source Project License granted to https://www.atlassian.com/software/views/opensource-community-additional-license-offer. Evaluate Confluence today.

  • Kolekti ThemeBuilder Powered by Atlassian Confluence 8.5.23
  • Kolekti ThemeBuilder printed.by.atlassian.confluence
  • Report a bug
  • Atlassian News
Atlassian
Kolekti ThemeBuilder EngineAtlassian Confluence
{"serverDuration": 268, "requestCorrelationId": "83b8ae356642db46"}