All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.epam.deltix.thread.affinity.AffinityLayout Maven / Gradle / Ivy

Go to download

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);

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy