Package org.aksw.commons.util.concurrent
Class ExecutorServiceUtils
- java.lang.Object
-
- org.aksw.commons.util.concurrent.ExecutorServiceUtils
-
public class ExecutorServiceUtils extends Object
-
-
Constructor Summary
Constructors Constructor Description ExecutorServiceUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ExecutorServicenewBlockingThreadPoolExecutor()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.static ExecutorServicenewBlockingThreadPoolExecutor(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.
-
-
-
Method Detail
-
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.
-
-