Package oshi.driver.windows
Class LogicalProcessorInformation
- java.lang.Object
-
- oshi.driver.windows.LogicalProcessorInformation
-
@ThreadSafe public final class LogicalProcessorInformation extends java.lang.Object
Utility to query Logical Processor Information
-
-
Field Summary
Fields Modifier and Type Field Description private static boolean
IS_WIN10_OR_GREATER
-
Constructor Summary
Constructors Modifier Constructor Description private
LogicalProcessorInformation()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static int
getBitMatchingPackageNumber(java.util.List<java.lang.Long> packageMaskList, int logProc)
Iterate over the package mask list and find a matching mask indexstatic Triplet<java.util.List<CentralProcessor.LogicalProcessor>,java.util.List<CentralProcessor.PhysicalProcessor>,java.util.List<CentralProcessor.ProcessorCache>>
getLogicalProcessorInformation()
Get a list of logical processors on this machinestatic Triplet<java.util.List<CentralProcessor.LogicalProcessor>,java.util.List<CentralProcessor.PhysicalProcessor>,java.util.List<CentralProcessor.ProcessorCache>>
getLogicalProcessorInformationEx()
Get a list of logical processors on this machine.private static int
getMatchingCore(java.util.List<com.sun.jna.platform.win32.WinNT.GROUP_AFFINITY> cores, int g, int lp)
private static int
getMatchingPackage(java.util.List<com.sun.jna.platform.win32.WinNT.GROUP_AFFINITY[]> packages, int g, int lp)
private static java.util.List<CentralProcessor.PhysicalProcessor>
getPhysProcs(java.util.List<com.sun.jna.platform.win32.WinNT.GROUP_AFFINITY> cores, java.util.Map<com.sun.jna.platform.win32.WinNT.GROUP_AFFINITY,java.lang.Integer> coreEfficiencyMap, java.util.Map<java.lang.Integer,java.lang.Integer> corePkgMap, java.util.Map<java.lang.Integer,java.lang.String> coreCpuidMap)
-
-
-
Method Detail
-
getLogicalProcessorInformationEx
public static Triplet<java.util.List<CentralProcessor.LogicalProcessor>,java.util.List<CentralProcessor.PhysicalProcessor>,java.util.List<CentralProcessor.ProcessorCache>> getLogicalProcessorInformationEx()
Get a list of logical processors on this machine. Requires Windows 7 and higher.- Returns:
- A list of logical processors
-
getPhysProcs
private static java.util.List<CentralProcessor.PhysicalProcessor> getPhysProcs(java.util.List<com.sun.jna.platform.win32.WinNT.GROUP_AFFINITY> cores, java.util.Map<com.sun.jna.platform.win32.WinNT.GROUP_AFFINITY,java.lang.Integer> coreEfficiencyMap, java.util.Map<java.lang.Integer,java.lang.Integer> corePkgMap, java.util.Map<java.lang.Integer,java.lang.String> coreCpuidMap)
-
getMatchingPackage
private static int getMatchingPackage(java.util.List<com.sun.jna.platform.win32.WinNT.GROUP_AFFINITY[]> packages, int g, int lp)
-
getMatchingCore
private static int getMatchingCore(java.util.List<com.sun.jna.platform.win32.WinNT.GROUP_AFFINITY> cores, int g, int lp)
-
getLogicalProcessorInformation
public static Triplet<java.util.List<CentralProcessor.LogicalProcessor>,java.util.List<CentralProcessor.PhysicalProcessor>,java.util.List<CentralProcessor.ProcessorCache>> getLogicalProcessorInformation()
Get a list of logical processors on this machine- Returns:
- A list of logical processors
-
getBitMatchingPackageNumber
private static int getBitMatchingPackageNumber(java.util.List<java.lang.Long> packageMaskList, int logProc)
Iterate over the package mask list and find a matching mask index- Parameters:
packageMaskList
- The list of bitmasks to iteratelogProc
- The bit to find matching mask- Returns:
- The index of the list which matched the bit
-
-