Package net.officefloor.web.executive
Class CpuCore
- java.lang.Object
-
- net.officefloor.web.executive.CpuCore
-
public class CpuCore extends java.lang.ObjectCore information linked to logical CPUs.- Author:
- Daniel Sagenschneider
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceCpuCore.CustomExecution<R,T extends java.lang.Throwable>FunctionalInterfacefor customCpuLayoutexecution.static classCpuCore.LogicalCpuLogical CPU on a Core.
-
Constructor Summary
Constructors Constructor Description CpuCore(int coreId, java.util.BitSet coreAffinity, CpuCore.LogicalCpu[] cpus)Instantiate.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.BitSetgetCoreAffinity()Obtains theCpuCoreBitSetaffinity.intgetCoreId()Obtains the Core identifier.static CpuCore[]getCores()Obtains theCpuCoreinstances.CpuCore.LogicalCpu[]getCpus()Obtains theCpuCore.LogicalCpuinstances on thisCpuCore.static <R,T extends java.lang.Throwable>
RrunWithCpuLayout(net.openhft.affinity.CpuLayout layout, CpuCore.CustomExecution<R,T> customExecution)Runs with customCpuLayout.
-
-
-
Constructor Detail
-
CpuCore
public CpuCore(int coreId, java.util.BitSet coreAffinity, CpuCore.LogicalCpu[] cpus)Instantiate.- Parameters:
coreId- Core identifier.coreAffinity- AffinityBitSetfor allCpuCore.LogicalCpuinstances on theCpuCore.cpus-CpuCore.LogicalCpuinstances for theCpuCore.
-
-
Method Detail
-
runWithCpuLayout
public static <R,T extends java.lang.Throwable> R runWithCpuLayout(net.openhft.affinity.CpuLayout layout, CpuCore.CustomExecution<R,T> customExecution) throws T extends java.lang.ThrowableRuns with custom
CpuLayout.This for example, allows restricting access to particular CPU cores or logical CPUs.
- Type Parameters:
R- Return type.T- PossibleThrowabletype.- Parameters:
layout-CpuLayout.customExecution-CpuCore.CustomExecution.- Returns:
- Possible return value.
- Throws:
T- Failure on running.T extends java.lang.Throwable
-
getCores
public static CpuCore[] getCores()
Obtains theCpuCoreinstances.- Returns:
CpuCoreinstances.
-
getCoreId
public int getCoreId()
Obtains the Core identifier.- Returns:
- Core identifier.
-
getCoreAffinity
public java.util.BitSet getCoreAffinity()
Obtains theCpuCoreBitSetaffinity.- Returns:
CpuCoreBitSetaffinity.
-
getCpus
public CpuCore.LogicalCpu[] getCpus()
Obtains theCpuCore.LogicalCpuinstances on thisCpuCore.- Returns:
CpuCore.LogicalCpuinstances on thisCpuCore.
-
-