pt.runtime
Class TaskpoolFIFOWorkSharing

java.lang.Object
  extended by pt.runtime.AbstractTaskPool
      extended by pt.runtime.TaskpoolFIFOWorkSharing
All Implemented Interfaces:
Taskpool

public class TaskpoolFIFOWorkSharing
extends AbstractTaskPool


Field Summary
 
Fields inherited from class pt.runtime.AbstractTaskPool
FIFO_TaskID_Comparator, globalTaskqueue, INITIAL_QUEUE_CAPACITY, lastStolenFrom, LIFO_TaskID_Comparator, localQueues, mixedQueue, NOT_STOLEN, numThreads, privateQueues, waitingTasks, workers
 
Constructor Summary
TaskpoolFIFOWorkSharing()
           
 
Method Summary
protected  void enqueueReadyTask(TaskID taskID)
           
 boolean executeSynchronously(int cutoff)
           
protected  void initialise()
           
 TaskID workerPollNextTask()
          Tries to poll for a task for the current worker..
 
Methods inherited from class pt.runtime.AbstractTaskPool
enqueue, enqueueMulti, enqueueWaitingTask, getActiveInteractiveTaskCount, initialiseWorkerThreads, interactiveTaskCompleted, nowReady, printDebugInfo, startInteractiveTask, startPipelineTask, totalNumTasksExecuted, workerTakeNextTask
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TaskpoolFIFOWorkSharing

public TaskpoolFIFOWorkSharing()
Method Detail

enqueueReadyTask

protected void enqueueReadyTask(TaskID taskID)
Specified by:
enqueueReadyTask in class AbstractTaskPool

workerPollNextTask

public TaskID workerPollNextTask()
Tries to poll for a task for the current worker.. first checks private queue, then global queue If it finds a task on the global queue saved for another worker, then it is put on the private queue for thar worker thread This is non-blocking - therefore it returns null if it didnt find a task If a canceled task is found, then it is discarded (but labeled "complete")

Specified by:
workerPollNextTask in interface Taskpool
Specified by:
workerPollNextTask in class AbstractTaskPool
Returns:
the task appropriate for the current worker, otherwise null if there wasnt one at this time

executeSynchronously

public boolean executeSynchronously(int cutoff)
Specified by:
executeSynchronously in interface Taskpool
Overrides:
executeSynchronously in class AbstractTaskPool

initialise

protected void initialise()
Specified by:
initialise in class AbstractTaskPool