Class PinnedExecutors
- java.lang.Object
-
- org.sheinbergon.needle.concurrent.PinnedExecutors
-
public final class PinnedExecutors extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.concurrent.ExecutorServicenewFixedPinnedThreadPool(int size, PinnedThreadFactory factory)Static factory methods for affinity aware fixed-sizeExecutorServiceinception.static java.util.concurrent.ForkJoinPoolnewPinnedWorkStealingPool(int parallelism, PinnedThreadFactory factory)Creates a new affinity awareForkJoinPoolwith the given parameters.static java.util.concurrent.ScheduledExecutorServicenewScheduledPinnedThreadPool(int size, PinnedThreadFactory factory)Static factory methods for affinity aware fixed-sizeScheduledExecutorServiceinception.static java.util.concurrent.ExecutorServicenewSinglePinnedThreadExecutor(PinnedThreadFactory factory)Static factory methods for affinity aware single-threadExecutorServiceinception.static java.util.concurrent.ScheduledExecutorServicenewSinglePinnedThreadScheduledExecutor(PinnedThreadFactory factory)Static factory methods for affinity aware single-threadScheduledExecutorServiceinception.
-
-
-
Method Detail
-
newSinglePinnedThreadExecutor
public static java.util.concurrent.ExecutorService newSinglePinnedThreadExecutor(@Nonnull PinnedThreadFactory factory)Static factory methods for affinity aware single-threadExecutorServiceinception.- Parameters:
factory- thePinnedThreadFactoryused to create affinity awarePinnedThreadinstances- Returns:
- the affinity aware
ExecutorService
-
newFixedPinnedThreadPool
public static java.util.concurrent.ExecutorService newFixedPinnedThreadPool(int size, @Nonnull PinnedThreadFactory factory)Static factory methods for affinity aware fixed-sizeExecutorServiceinception.- Parameters:
size- number ofPinnedThreadinstances to maintain in the poolfactory- thePinnedThreadFactoryused create affinity awarePinnedThreadinstances- Returns:
- the affinity aware
ExecutorService
-
newSinglePinnedThreadScheduledExecutor
public static java.util.concurrent.ScheduledExecutorService newSinglePinnedThreadScheduledExecutor(@Nonnull PinnedThreadFactory factory)Static factory methods for affinity aware single-threadScheduledExecutorServiceinception.- Parameters:
factory- thePinnedThreadFactoryused create affinity awarePinnedThreadinstances- Returns:
- the affinity aware
ScheduledExecutorService
-
newScheduledPinnedThreadPool
public static java.util.concurrent.ScheduledExecutorService newScheduledPinnedThreadPool(int size, @Nonnull PinnedThreadFactory factory)Static factory methods for affinity aware fixed-sizeScheduledExecutorServiceinception.- Parameters:
size- number ofPinnedThreadinstances to maintain in the poolfactory- thePinnedThreadFactoryused create affinity awarePinnedThreadinstances- Returns:
- the affinity aware
ScheduledExecutorService
-
newPinnedWorkStealingPool
public static java.util.concurrent.ForkJoinPool newPinnedWorkStealingPool(int parallelism, @Nonnull PinnedThreadFactory factory)Creates a new affinity awareForkJoinPoolwith the given parameters.- Parameters:
parallelism- the parallelism level (amount of worker threads to be spawned)factory- thePinnedThreadfactory to use when the executor creates new fork-join worker threads- Returns:
- an affinity aware
ForkJoinPool
-
-