ork::Scheduler Class Reference
[taskgraph]

An abstract scheduler, sorts and executes tasks with one or more threads. More...

#include <Scheduler.h>

Inheritance diagram for ork::Scheduler:
ork::Object ork::MultithreadScheduler

List of all members.

Public Member Functions

 Scheduler (const char *type)
 Creates a new scheduler.
virtual ~Scheduler ()
 Deletes this scheduler.
virtual bool supportsPrefetch (bool gpuTasks)=0
 Returns true if this scheduler can execute CPU or GPU tasks whose deadline is not immediate.
virtual void schedule (ptr< Task > task)=0
 Adds a task whose deadline is not immediate.
virtual void reschedule (ptr< Task > task, Task::reason r, unsigned int deadline)=0
 Forces the reexecution of the given task and of its sub tasks.
virtual void run (ptr< Task > task)=0
 Executes the given tasks.

Protected Member Functions

void swap (ptr< Scheduler > s)
 Swaps this scheduler with the given one.

Detailed Description

An abstract scheduler, sorts and executes tasks with one or more threads.


Constructor & Destructor Documentation

ork::Scheduler::Scheduler ( const char *  type  ) 

Creates a new scheduler.

Parameters:
type the type of this scheduler.
virtual ork::Scheduler::~Scheduler (  )  [virtual]

Deletes this scheduler.


Member Function Documentation

virtual void ork::Scheduler::reschedule ( ptr< Task task,
Task::reason  r,
unsigned int  deadline 
) [pure virtual]

Forces the reexecution of the given task and of its sub tasks.

Parameters:
task a task or task graph that must be reexecuted. This task is marked as undone (with Task::setIsDone) so that it will be reexecuted.
r the reason why the task must be reexecuted.
deadline the frame number before which this task must be reexecuted.

Implemented in ork::MultithreadScheduler.

virtual void ork::Scheduler::run ( ptr< Task task  )  [pure virtual]

Executes the given tasks.

This method does not return before all tasks with an immediate deadline are completed.

Parameters:
task a task or task graph to be executed.

Implemented in ork::MultithreadScheduler.

virtual void ork::Scheduler::schedule ( ptr< Task task  )  [pure virtual]

Adds a task whose deadline is not immediate.

This method must not be called if this scheduler does not support prefetch (see supportsPrefetch). Otherwise it adds this task and its sub tasks to the list of tasks to be executed by this scheduler, and returns immediately (i.e. before these tasks are executed).

Parameters:
task a task or task graph whose deadline is not immediate.

Implemented in ork::MultithreadScheduler.

virtual bool ork::Scheduler::supportsPrefetch ( bool  gpuTasks  )  [pure virtual]

Returns true if this scheduler can execute CPU or GPU tasks whose deadline is not immediate.

This means tasks whose result will be needed in the next few frames, but that are known in advance and could be computed ahead of time to reduce the load of these coming frames.

Parameters:
gpuTasks true to know if this scheduler can prefetch GPU tasks, or false to know if it can prefetch CPU tasks.
Returns:
true if this scheduler can prefetch GPU (resp. CPU) tasks, if gpuTasks is true (resp. false).

Implemented in ork::MultithreadScheduler.

void ork::Scheduler::swap ( ptr< Scheduler s  )  [protected]

Swaps this scheduler with the given one.


Generated on Mon Oct 18 09:36:12 2010 for ork by  doxygen 1.6.1