Class ExecutorServiceUtils

java.lang.Object
org.aksw.commons.util.concurrent.ExecutorServiceUtils

public class ExecutorServiceUtils extends Object
  • Constructor Details

    • ExecutorServiceUtils

      public ExecutorServiceUtils()
  • Method Details

    • newBlockingThreadPoolExecutor

      public static ExecutorService newBlockingThreadPoolExecutor()
      Create a default thread pool executor with twice as many threads as there are processors reported by the JVM (assumes hyperthreading), and allowing a queue size of 10 per thread.
      Returns:
    • newBlockingThreadPoolExecutor

      public static ExecutorService newBlockingThreadPoolExecutor(int threads, int queueSize)
      A util method from stack overflow (link?) to avoid unbounding queuing of tasks Submitting a task to an executor when its queue is full will block.