pt.runtime
Class TaskpoolLIFOWorkStealing

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

public class TaskpoolLIFOWorkStealing
extends AbstractTaskPool

There is no global queue, all tasks are placed on private queues in a round-robin fashion. If workers start to run out of work, then they steal (randomly) from another worker. [this is similar to JCilk]. (Maybe this could be enhanced by favoring to steal from a worker that we last succeeded to steal from). Private queues are ordered such that workers get the head, while thiefs get the tail.


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
TaskpoolLIFOWorkStealing()
           
 
Method Summary
protected  void enqueueReadyTask(TaskID<?> taskID)
           
protected  void initialise()
           
 TaskID workerPollNextTask()
          The worker thread polls the task pool for a task..
 
Methods inherited from class pt.runtime.AbstractTaskPool
enqueue, enqueueMulti, enqueueWaitingTask, executeSynchronously, 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

TaskpoolLIFOWorkStealing

public TaskpoolLIFOWorkStealing()
Method Detail

enqueueReadyTask

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

workerPollNextTask

public TaskID workerPollNextTask()
Description copied from interface: Taskpool
The worker thread polls the task pool for a task.. If there isn't one, then it returns immediately (returns null in such a case).

Specified by:
workerPollNextTask in interface Taskpool
Specified by:
workerPollNextTask in class AbstractTaskPool
Returns:

initialise

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