Class CpuAffinity
java.lang.Object
org.apache.bookkeeper.common.util.affinity.CpuAffinity
Utilities for enabling thread to CPU affinity.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidAcquire ownership of one CPU core for the current thread.
-
Method Details
-
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,7parameter - 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
-