ca.nengo.util.impl
Class NodeThreadPool

java.lang.Object
  extended by ca.nengo.util.impl.NodeThreadPool

public class NodeThreadPool
extends java.lang.Object

A pool of threads for running nodes in. All interaction with the threads is done through this class

Author:
Eric Crawford

Field Summary
protected static int defaultNumThreads
           
protected  float myEndTime
           
protected  java.lang.Object myLock
           
protected  Node[] myNodes
           
protected static int myNumThreads
           
protected  Projection[] myProjections
           
protected  float myStartTime
           
protected  NodeThread[] myThreads
           
protected  int numThreadsComplete
           
protected  boolean runFinished
           
protected  boolean threadsRunning
           
 
Constructor Summary
protected NodeThreadPool()
           
  NodeThreadPool(Node[] nodes, Projection[] projections)
           
 
Method Summary
 float getEndTime()
           
static int getNumThreads()
           
 boolean getRunFinished()
           
 float getStartTime()
           
protected  void initialize(Node[] nodes, Projection[] projections)
           
static boolean isMultithreading()
           
 void kill()
           
static void setNumThreads(int value)
           
 void step(float startTime, float endTime)
           
 void threadFinished()
           
 void threadWait()
           
static void turnOffMultithreading()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

defaultNumThreads

protected static final int defaultNumThreads
See Also:
Constant Field Values

myNumThreads

protected static int myNumThreads

myThreads

protected NodeThread[] myThreads

myLock

protected java.lang.Object myLock

myNodes

protected Node[] myNodes

myProjections

protected Projection[] myProjections

numThreadsComplete

protected volatile int numThreadsComplete

threadsRunning

protected volatile boolean threadsRunning

runFinished

protected volatile boolean runFinished

myStartTime

protected float myStartTime

myEndTime

protected float myEndTime
Constructor Detail

NodeThreadPool

protected NodeThreadPool()

NodeThreadPool

public NodeThreadPool(Node[] nodes,
                      Projection[] projections)
Method Detail

getNumThreads

public static int getNumThreads()

setNumThreads

public static void setNumThreads(int value)

isMultithreading

public static boolean isMultithreading()

turnOffMultithreading

public static void turnOffMultithreading()

getStartTime

public float getStartTime()

getEndTime

public float getEndTime()

getRunFinished

public boolean getRunFinished()

initialize

protected void initialize(Node[] nodes,
                          Projection[] projections)

step

public void step(float startTime,
                 float endTime)

threadWait

public void threadWait()
                throws java.lang.InterruptedException
Throws:
java.lang.InterruptedException

threadFinished

public void threadFinished()
                    throws java.lang.InterruptedException
Throws:
java.lang.InterruptedException

kill

public void kill()