Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8154176

Threads Native ID should be available from Thread and/or ThreadMXBean.getThreadInfo()

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Won't Fix
    • Icon: P4 P4
    • tbd
    • 8u74
    • core-svc
    • None

      Something that was overlooked by JEP 102: Process API Updates, where we finally get access to the PID, is that native Thread IDs are still inaccessible.

      There are many reasons that we would want access to the native thread ID. One being to set or query processor affinity which can have significant impact in NUMA machines.

      This should be a safe and simple addition to the ThreadInfo object. the data is available from HotSpot thread dumps, so with a JDK installed it can be parsed from a text dump obtained through the Attach mechanism and calling sun.tools.attach.HotSpotVirtualMachine.remoteDataDump(). But of course that class is not part of the public API either, and parsing the text output is an awkward hack.

            Unassigned Unassigned
            swpalmer Scott Palmer
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: