Class CpuAffinity
- java.lang.Object
-
- org.apache.bookkeeper.common.util.affinity.CpuAffinity
-
public final class CpuAffinity extends java.lang.Object
Utilities for enabling thread to CPU affinity.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
acquireCore()
Acquire ownership of one CPU core for the current thread.
-
-
-
Method Detail
-
acquireCore
public static void acquireCore()
Acquire ownership of one CPU core for the current thread.Notes:
- This method will only consider CPUs that are "isolated" by the OS. Eg: boot the kernel with
isolcpus=2,3,6,7
parameter - This method will disable hyper-threading on the owned core
- Once a thread successfully acquires a CPU, ownership will be retained, even if the thread exits, for as long as the JVM process is alive.
- This method will only consider CPUs that are "isolated" by the OS. Eg: boot the kernel with
-
-