pt.runtime
Interface Taskpool

All Known Implementing Classes:
AbstractTaskPool, TaskpoolFIFOWorkSharing, TaskpoolLIFOWorkStealing, TaskpoolMixedScheduling

public interface Taskpool


Method Summary
 TaskID enqueue(TaskInfo taskinfo)
          Enqueues the specified task, whose information is contained in the TaskInfo.
 TaskIDGroup enqueueMulti(TaskInfo taskinfo, int count)
          Enqueues the specified TaskInfo as a multi-task, creates "count" inner tasks and places them in a TaskIDGroup which is then returned.
 boolean executeSynchronously(int cutoff)
           
 int getActiveInteractiveTaskCount()
          Returns the count of currently active interactive tasks.
 void interactiveTaskCompleted(TaskID<?> taskID)
          Used to decrement the count of interactive tasks
 void nowReady(TaskID<?> taskID)
          The specified task is currently on the waiting queue since it has some dependences.
 void printDebugInfo()
           
 int totalNumTasksExecuted()
           
 TaskID workerPollNextTask()
          The worker thread polls the task pool for a task..
 TaskID workerTakeNextTask()
          The worker thread blocks until it gets a task to execute.
 

Method Detail

nowReady

void nowReady(TaskID<?> taskID)
The specified task is currently on the waiting queue since it has some dependences. However, all thoses dependences have now been met and the task is ready to be scheduled for execution.

Parameters:
taskID -

getActiveInteractiveTaskCount

int getActiveInteractiveTaskCount()
Returns the count of currently active interactive tasks. This is usually to know how many threads there are.

Returns:

interactiveTaskCompleted

void interactiveTaskCompleted(TaskID<?> taskID)
Used to decrement the count of interactive tasks

Parameters:
taskID - The task that has just completed

enqueue

TaskID enqueue(TaskInfo taskinfo)
Enqueues the specified task, whose information is contained in the TaskInfo. It then returns a TaskID to represent that task.

Parameters:
taskinfo -
Returns:

enqueueMulti

TaskIDGroup enqueueMulti(TaskInfo taskinfo,
                         int count)
Enqueues the specified TaskInfo as a multi-task, creates "count" inner tasks and places them in a TaskIDGroup which is then returned.

Parameters:
taskinfo -
count -
Returns:

workerPollNextTask

TaskID workerPollNextTask()
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).

Returns:

workerTakeNextTask

TaskID workerTakeNextTask()
The worker thread blocks until it gets a task to execute.

Returns:

executeSynchronously

boolean executeSynchronously(int cutoff)

printDebugInfo

void printDebugInfo()

totalNumTasksExecuted

int totalNumTasksExecuted()