Class PinnedExecutors


  • public final class PinnedExecutors
    extends java.lang.Object
    • Method Detail

      • newSinglePinnedThreadExecutor

        public static java.util.concurrent.ExecutorService newSinglePinnedThreadExecutor​(@Nonnull
                                                                                         PinnedThreadFactory factory)
        Static factory methods for affinity aware single-thread ExecutorService inception.
        Parameters:
        factory - the PinnedThreadFactory used to create affinity aware PinnedThread instances
        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-size ExecutorService inception.
        Parameters:
        size - number of PinnedThread instances to maintain in the pool
        factory - the PinnedThreadFactory used create affinity aware PinnedThread instances
        Returns:
        the affinity aware ExecutorService
      • newSinglePinnedThreadScheduledExecutor

        public static java.util.concurrent.ScheduledExecutorService newSinglePinnedThreadScheduledExecutor​(@Nonnull
                                                                                                           PinnedThreadFactory factory)
        Static factory methods for affinity aware single-thread ScheduledExecutorService inception.
        Parameters:
        factory - the PinnedThreadFactory used create affinity aware PinnedThread instances
        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-size ScheduledExecutorService inception.
        Parameters:
        size - number of PinnedThread instances to maintain in the pool
        factory - the PinnedThreadFactory used create affinity aware PinnedThread instances
        Returns:
        the affinity aware ScheduledExecutorService
      • newPinnedWorkStealingPool

        public static java.util.concurrent.ForkJoinPool newPinnedWorkStealingPool​(int parallelism,
                                                                                  @Nonnull
                                                                                  PinnedThreadFactory factory)
        Creates a new affinity aware ForkJoinPool with the given parameters.
        Parameters:
        parallelism - the parallelism level (amount of worker threads to be spawned)
        factory - the PinnedThread factory to use when the executor creates new fork-join worker threads
        Returns:
        an affinity aware ForkJoinPool