public class ThreadManager
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
ThreadManager.MyRunnable
MyRunnable
|
| Modifier and Type | Field and Description |
|---|---|
boolean |
debug |
static int |
MAX_THREADS |
| Constructor and Description |
|---|
ThreadManager() |
ThreadManager(int maxThreads) |
ThreadManager(java.lang.String theName)
Constructor with name specified
|
| Modifier and Type | Method and Description |
|---|---|
void |
addRunnable(ThreadManager.MyRunnable runnable) |
static void |
clearTimes() |
void |
debug(java.lang.String msg) |
static void |
doWork(int amt,
int[] A) |
java.util.List<java.lang.Exception> |
getExceptions()
Return the list of any exceptions that were thrown when running the threads
|
static int |
getGlobalMaxThreads() |
int |
getNumRunnables() |
void |
handleException(java.lang.Exception exc) |
static void |
main(java.lang.String[] args)
Main method for testing
|
void |
runAllParallel() |
void |
runInParallel() |
void |
runInParallel(boolean doAverage) |
void |
runInParallel(int maxThreads) |
void |
runnableStarted() |
void |
runnableStopped() |
void |
runSequentially() |
static void |
setGlobalMaxThreads(int max) |
public boolean debug
public static final int MAX_THREADS
public ThreadManager()
public ThreadManager(java.lang.String theName)
theName - public ThreadManager(int maxThreads)
maxThreads - public static void setGlobalMaxThreads(int max)
max - public static int getGlobalMaxThreads()
public void debug(java.lang.String msg)
public static void clearTimes()
public void addRunnable(ThreadManager.MyRunnable runnable)
runnable - public void handleException(java.lang.Exception exc)
exc - public void runnableStopped()
public void runnableStarted()
public int getNumRunnables()
public void runInParallel(int maxThreads)
throws VisADException,
java.rmi.RemoteException
maxThreads - java.rmi.RemoteExceptionVisADExceptionpublic void runSequentially()
throws VisADException,
java.rmi.RemoteException
java.rmi.RemoteExceptionVisADExceptionpublic void runAllParallel()
throws VisADException,
java.rmi.RemoteException
java.rmi.RemoteExceptionVisADExceptionpublic void runInParallel()
throws VisADException,
java.rmi.RemoteException
java.rmi.RemoteExceptionVisADExceptionpublic void runInParallel(boolean doAverage)
throws VisADException,
java.rmi.RemoteException
doAverage - java.rmi.RemoteExceptionVisADExceptionpublic java.util.List<java.lang.Exception> getExceptions()
public static final void doWork(int amt,
int[] A)
public static void main(java.lang.String[] args)
throws java.lang.Exception
args - argsjava.lang.Exception