Class CentralProcessor.LogicalProcessor

java.lang.Object
oshi.hardware.CentralProcessor.LogicalProcessor
Enclosing interface:
CentralProcessor

@PublicApi @Immutable public static class CentralProcessor.LogicalProcessor extends Object
A class representing a Logical Processor and its replationship to physical processors, physical packages, and logical groupings such as NUMA Nodes and Processor groups, useful for identifying processor topology.
  • Constructor Summary

    Constructors
    Constructor
    Description
    LogicalProcessor(int processorNumber, int physicalProcessorNumber, int physicalPackageNumber)
    Creates a LogicalProcessor with the given processor, core, and package numbers.
    LogicalProcessor(int processorNumber, int physicalProcessorNumber, int physicalPackageNumber, int numaNode)
    Creates a LogicalProcessor with the given processor, core, package, and NUMA node numbers.
    LogicalProcessor(int processorNumber, int physicalProcessorNumber, int physicalPackageNumber, int numaNode, int processorGroup)
    Creates a LogicalProcessor with the given processor, core, package, NUMA node, and processor group numbers.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    The NUMA node.
    int
    The physical package (socket) id number assigned to this logical processor.
    int
    The physical processor (core) id number assigned to this logical processor.
    int
    The Processor Group.
    int
    The Logical Processor number as seen by the Operating System.
     

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • LogicalProcessor

      public LogicalProcessor(int processorNumber, int physicalProcessorNumber, int physicalPackageNumber)
      Creates a LogicalProcessor with the given processor, core, and package numbers.
      Parameters:
      processorNumber - the Processor number
      physicalProcessorNumber - the core number
      physicalPackageNumber - the package/socket number
    • LogicalProcessor

      public LogicalProcessor(int processorNumber, int physicalProcessorNumber, int physicalPackageNumber, int numaNode)
      Creates a LogicalProcessor with the given processor, core, package, and NUMA node numbers.
      Parameters:
      processorNumber - the Processor number
      physicalProcessorNumber - the core number
      physicalPackageNumber - the package/socket number
      numaNode - the NUMA node number
    • LogicalProcessor

      public LogicalProcessor(int processorNumber, int physicalProcessorNumber, int physicalPackageNumber, int numaNode, int processorGroup)
      Creates a LogicalProcessor with the given processor, core, package, NUMA node, and processor group numbers.
      Parameters:
      processorNumber - the Processor number
      physicalProcessorNumber - the core number
      physicalPackageNumber - the package/socket number
      numaNode - the NUMA node number
      processorGroup - the Processor Group number
  • Method Details

    • getProcessorNumber

      public int getProcessorNumber()
      The Logical Processor number as seen by the Operating System. Used for assigning process affinity and reporting CPU usage and other statistics.
      Returns:
      the processorNumber
    • getPhysicalProcessorNumber

      public int getPhysicalProcessorNumber()
      The physical processor (core) id number assigned to this logical processor. Hyperthreaded logical processors which share the same physical processor will have the same number.
      Returns:
      the physicalProcessorNumber
    • getPhysicalPackageNumber

      public int getPhysicalPackageNumber()
      The physical package (socket) id number assigned to this logical processor. Multicore CPU packages may have multiple physical processors which share the same number.
      Returns:
      the physicalPackageNumber
    • getNumaNode

      public int getNumaNode()
      The NUMA node. If the operating system supports Non-Uniform Memory Access this identifies the node number. Set to 0 if the operating system does not support NUMA. Not supported on macOS or FreeBSD.
      Returns:
      the NUMA Node number
    • getProcessorGroup

      public int getProcessorGroup()
      The Processor Group. Only applies to Windows systems with more than 64 logical processors. Set to 0 for other operating systems or Windows systems with 64 or fewer logical processors.
      Returns:
      the processorGroup
    • toString

      public String toString()
      Overrides:
      toString in class Object