Package net.officefloor.web.executive
Class CpuCore
java.lang.Object
net.officefloor.web.executive.CpuCore
Core information linked to logical CPUs.
- Author:
- Daniel Sagenschneider
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceCpuCore.CustomExecution<R,T extends Throwable> FunctionalInterfacefor customCpuLayoutexecution.static classLogical CPU on a Core. -
Constructor Summary
ConstructorsConstructorDescriptionCpuCore(int coreId, BitSet coreAffinity, CpuCore.LogicalCpu[] cpus) Instantiate. -
Method Summary
Modifier and TypeMethodDescriptionintObtains the Core identifier.static CpuCore[]getCores()Obtains theCpuCoreinstances.getCpus()Obtains theCpuCore.LogicalCpuinstances on thisCpuCore.static <R,T extends Throwable>
RrunWithCpuLayout(net.openhft.affinity.CpuLayout layout, CpuCore.CustomExecution<R, T> customExecution) Runs with customCpuLayout.
-
Constructor Details
-
CpuCore
Instantiate.- Parameters:
coreId- Core identifier.coreAffinity- AffinityBitSetfor allCpuCore.LogicalCpuinstances on theCpuCore.cpus-CpuCore.LogicalCpuinstances for theCpuCore.
-
-
Method Details
-
runWithCpuLayout
public static <R,T extends Throwable> R runWithCpuLayout(net.openhft.affinity.CpuLayout layout, CpuCore.CustomExecution<R, T> customExecution) throws TRuns 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.
-
getCores
Obtains theCpuCoreinstances.- Returns:
CpuCoreinstances.
-
getCoreId
public int getCoreId()Obtains the Core identifier.- Returns:
- Core identifier.
-
getCoreAffinity
-
getCpus
Obtains theCpuCore.LogicalCpuinstances on thisCpuCore.- Returns:
CpuCore.LogicalCpuinstances on thisCpuCore.
-