com.epam.deltix.thread.affinity.AffinityLayout Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ThreadAffinity Show documentation
Show all versions of ThreadAffinity Show documentation
A wrapper over net.openhft:affinity providing handy classes to create threads pinned to the specified CPUs.
The newest version!
package com.epam.deltix.thread.affinity;
import javax.annotation.Nonnull;
import javax.annotation.ParametersAreNonnullByDefault;
import java.util.BitSet;
@FunctionalInterface
@ParametersAreNonnullByDefault
public interface AffinityLayout {
/**
* Empty affinity mask.
*/
AffinityLayout NO_LAYOUT = (thread) -> new BitSet();
/**
* Returns affinity mask for specific thread.
* Returns empty mask if unknown.
*
* @param thread thread.
* @return affinity mask for specific thread or empty mask if unknown.
*/
@Nonnull
BitSet getMask(@Nonnull Thread thread);
}