cz.vutbr.fit.healing
Class HealingDummyThread

java.lang.Object
  extended by java.lang.Thread
      extended by cz.vutbr.fit.healing.HealingDummyThread
All Implemented Interfaces:
java.lang.Runnable

public class HealingDummyThread
extends java.lang.Thread

This class implements dummy threads which are started on the machines with more processors (cores) to utilize them except one devoted for thread in the critical section.

Threads are initialized and forced to wait till someone call goAll then they forced to wait by stopAll method. A wait-notifyAll aproach is used for the synchronization.

Author:
zdenek

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 int num
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
HealingDummyThread()
           
 
Method Summary
static void endAll()
          Finnish all threads.
static void goAll()
          Runs all waiting threads.
 void run()
          Runs dummy thread.
static void stopAll()
          Stops all running threads.
 
Methods inherited from class java.lang.Thread
activeCount, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, checkAccess, 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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

num

public int num
Constructor Detail

HealingDummyThread

public HealingDummyThread()
Method Detail

run

public void run()
Runs dummy thread.

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

goAll

public static void goAll()
Runs all waiting threads.


stopAll

public static void stopAll()
Stops all running threads.


endAll

public static void endAll()
Finnish all threads.