Class FastThreadPoolExecutor

java.lang.Object
java.util.concurrent.AbstractExecutorService
java.util.concurrent.ThreadPoolExecutor
org.opendaylight.yangtools.util.concurrent.FastThreadPoolExecutor
All Implemented Interfaces:
Executor, ExecutorService

public class FastThreadPoolExecutor extends ThreadPoolExecutor
A ThreadPoolExecutor with a specified bounded queue capacity that favors creating new threads over queuing, as the former is faster.

See SpecialExecutors.newBoundedFastThreadPool(int, int, java.lang.String, java.lang.Class<?>) for more details.

Author:
Thomas Pantelis
  • Constructor Details

    • FastThreadPoolExecutor

      public FastThreadPoolExecutor(int maximumPoolSize, int maximumQueueSize, String threadPrefix, Class<?> loggerIdentity)
      Constructs a FastThreadPoolExecutor instance.
      Parameters:
      maximumPoolSize - the maximum number of threads to allow in the pool. Threads will terminate after being idle for 15 seconds.
      maximumQueueSize - the capacity of the queue.
      threadPrefix - the name prefix for threads created by this executor.
      loggerIdentity - the class to use as logger name for logging uncaught exceptions from the threads.
    • FastThreadPoolExecutor

      public FastThreadPoolExecutor(int maximumPoolSize, int maximumQueueSize, long keepAliveTime, TimeUnit unit, String threadPrefix, Class<?> loggerIdentity)
      Constructs a FastThreadPoolExecutor instance.
      Parameters:
      maximumPoolSize - the maximum number of threads to allow in the pool.
      maximumQueueSize - the capacity of the queue.
      keepAliveTime - the maximum time that idle threads will wait for new tasks before terminating.
      unit - the time unit for the keepAliveTime argument
      threadPrefix - the name prefix for threads created by this executor.
      loggerIdentity - the class to use as logger name for logging uncaught exceptions from the threads.
  • Method Details