edu.stanford.rsl.konrad.parallel
Class ParallelThread

java.lang.Object
  extended by java.lang.Thread
      extended by edu.stanford.rsl.konrad.parallel.ParallelThread
All Implemented Interfaces:
NamedParallelizableRunnable, ParallelizableRunnable, java.lang.Runnable
Direct Known Subclasses:
TessellationThread

public abstract class ParallelThread
extends java.lang.Thread
implements NamedParallelizableRunnable

Thread to be run with a ParallelThreadExecutor. Wraps the run method using the abstract method execute. Avoids deadlocks as exceptions in execute are caught and displayed. Nonetheless, the count down in the latch is performed. Hence, the ParallelThreadExecutor will not wait until the end of time.

Author:
akmaier

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
ParallelThread()
           
 
Method Summary
abstract  void execute()
          Defines the code to be executed.
 void run()
           
 void setLatch(java.util.concurrent.CountDownLatch latch)
           
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface edu.stanford.rsl.konrad.parallel.NamedParallelizableRunnable
getProcessName
 

Constructor Detail

ParallelThread

public ParallelThread()
Method Detail

setLatch

public void setLatch(java.util.concurrent.CountDownLatch latch)
Specified by:
setLatch in interface ParallelizableRunnable

run

public void run()
Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

execute

public abstract void execute()
Defines the code to be executed. Is called from the run method of the Thread.