Package jasima.core.expExecution
Class ThreadPoolExecutor
- java.lang.Object
-
- jasima.core.expExecution.ExperimentExecutor
-
- jasima.core.expExecution.ThreadPoolExecutor
-
public class ThreadPoolExecutor extends ExperimentExecutor
Default implementation of an ExecutorFactory returning an Executor that uses up to
Runtime.getRuntime().availableProcessors()threads to execute tasks concurrently. This number of threads can be overridden by setting the system property "jasima.core.expExecution.ThreadPoolExecutor.numThreads".In order to prevent starvation of worker threads waiting for sub-experiments to complete, there is a thread pool for each nesting level of experiments.
- Author:
- Torsten Hildebrandt
-
-
Field Summary
Fields Modifier and Type Field Description static StringPOOL_SIZE_SETTING-
Fields inherited from class jasima.core.expExecution.ExperimentExecutor
execFactoryImpl, EXECUTOR_FACTORY
-
-
Constructor Summary
Constructors Constructor Description ThreadPoolExecutor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ExecutorServiceexperimentExecutor(Experiment e, Experiment parent)Returns theExecutorServicethat should be used to execute theExperiment.voidshutdownNow()Shuts down thisExperimentExecutor.-
Methods inherited from class jasima.core.expExecution.ExperimentExecutor
getExecutor, runAllExperiments, runExperimentAsync, runExperimentAsync
-
-
-
-
Field Detail
-
POOL_SIZE_SETTING
public static final String POOL_SIZE_SETTING
-
-
Method Detail
-
experimentExecutor
public ExecutorService experimentExecutor(Experiment e, Experiment parent)
Description copied from class:ExperimentExecutorReturns theExecutorServicethat should be used to execute theExperiment.- Specified by:
experimentExecutorin classExperimentExecutor- Parameters:
e- The experiment to be executed.parent- A parent experiment that is executinge(can be null).- Returns:
- The
ExecutorServiceto execute it with.
-
shutdownNow
public void shutdownNow()
Description copied from class:ExperimentExecutorShuts down thisExperimentExecutor.- Specified by:
shutdownNowin classExperimentExecutor
-
-