java.lang.Object
oshi.hardware.CentralProcessor.LogicalProcessor
- Enclosing interface:
- CentralProcessor
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
ConstructorDescriptionLogicalProcessor
(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 TypeMethodDescriptionint
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.toString()
-
Constructor Details
-
LogicalProcessor
public LogicalProcessor(int processorNumber, int physicalProcessorNumber, int physicalPackageNumber) - Parameters:
processorNumber
- the Processor numberphysicalProcessorNumber
- the core numberphysicalPackageNumber
- the package/socket number
-
LogicalProcessor
public LogicalProcessor(int processorNumber, int physicalProcessorNumber, int physicalPackageNumber, int numaNode) - Parameters:
processorNumber
- the Processor numberphysicalProcessorNumber
- the core numberphysicalPackageNumber
- the package/socket numbernumaNode
- the NUMA node number
-
LogicalProcessor
public LogicalProcessor(int processorNumber, int physicalProcessorNumber, int physicalPackageNumber, int numaNode, int processorGroup) - Parameters:
processorNumber
- the Processor numberphysicalProcessorNumber
- the core numberphysicalPackageNumber
- the package/socket numbernumaNode
- the NUMA node numberprocessorGroup
- 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
-