Package oshi.hardware

Class CentralProcessor.LogicalProcessor

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

@Immutable
public static class CentralProcessor.LogicalProcessor
extends java.lang.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)  
    LogicalProcessor​(int processorNumber, int physicalProcessorNumber, int physicalPackageNumber, int numaNode)  
    LogicalProcessor​(int processorNumber, int physicalProcessorNumber, int physicalPackageNumber, int numaNode, int processorGroup)  
  • Method Summary

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

    Methods inherited from class java.lang.Object

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

    • LogicalProcessor

      public LogicalProcessor​(int processorNumber, int physicalProcessorNumber, int physicalPackageNumber)
      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)
      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)
      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