Package org.aksw.commons.util.concurrent
Class ExecutorServiceUtils
java.lang.Object
org.aksw.commons.util.concurrent.ExecutorServiceUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ExecutorServiceCreate 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.
-
Constructor Details
-
ExecutorServiceUtils
public ExecutorServiceUtils()
-
-
Method Details
-
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
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.
-