|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.encog.util.concurrency.EngineConcurrency
public class EngineConcurrency
This class abstracts thread pools, and potentially grids and other types of concurrency. It is used by other classes inside of Encog to allow tasks to be executed efficiently on multicore machines.
Constructor Summary | |
---|---|
EngineConcurrency()
Construct a concurrency object. |
Method Summary | |
---|---|
void |
checkError()
Check to see if one of the threads has thrown an error. |
TaskGroup |
createTaskGroup()
Create a new task group. |
static EngineConcurrency |
getInstance()
|
int |
getThreadCount()
|
void |
processTask(EngineTask task)
Process the specified task. |
void |
processTask(EngineTask task,
TaskGroup group)
Process the specified task. |
void |
registerError(Throwable t)
Allows threads to register errors, these errors will be thrown by the main thread. |
void |
setThreadCount(int t)
Set the number of threads to use. |
void |
shutdown(long timeout)
Wait for all threads in the pool to complete. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public EngineConcurrency()
Method Detail |
---|
public static EngineConcurrency getInstance()
public void setThreadCount(int t)
setThreadCount
in interface MultiThreadable
t
- The number of threads to use, or zero to
automatically determine based on core count.public void checkError()
public TaskGroup createTaskGroup()
public void processTask(EngineTask task)
task
- The task to process.public void processTask(EngineTask task, TaskGroup group)
task
- The task to process.group
- The task group.public void registerError(Throwable t)
t
- The error to register.public void shutdown(long timeout)
timeout
- How long to wait for all threads to complete.public int getThreadCount()
getThreadCount
in interface MultiThreadable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |