edu.stanford.rsl.konrad.parallel
Class ParallelThreadExecutor
java.lang.Object
edu.stanford.rsl.konrad.parallel.ParallelThreadExecutor
public class ParallelThreadExecutor
- extends java.lang.Object
Class to execute multiple ParallelizeableRunnables in parallel. The Executor will dispatch
as many ParallelizedRunnables as there are CPUs in the machine on which the code is executed in one batch.
Then it will wait until all processes in the current batch are done. As soon as this is the case a new batch
of processes is started. This is done until all ParallelizableRunnables are processed.
- Author:
- Andreas Maier
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ParallelThreadExecutor
public ParallelThreadExecutor(ParallelizableRunnable[] runnables)
- In order to have the threads performed in parallel just an Array of ParallelizableRunnables is
passed to the contructor of the ParallelThreadExecutor.
- Parameters:
runnables
- the processes to run.
ParallelThreadExecutor
public ParallelThreadExecutor(ParallelizableRunnable[] runnables,
int latchSize)
setShowStatus
public void setShowStatus(boolean showStatus)
isShowStatus
public boolean isShowStatus()
execute
public void execute()
throws java.lang.InterruptedException
- This method will start the processing.
- Throws:
java.lang.InterruptedException
- may occur.