#include <SerialAsync.h>
Public Types | |
typedef DataObject< SerialAsync > | DataObject_t |
typedef IterateScheduler < SerialAsync > | IterateScheduler_t |
Public Member Functions | |
Iterate (IterateScheduler< SerialAsync > &s, int affinity=-1) | |
The Constructor for this class takes the IterateScheduler and a CPU affinity. | |
virtual | ~Iterate () |
The dtor is virtual because the subclasses will need to add to it. | |
virtual void | run ()=0 |
The run method does the core work of the Iterate. | |
void | notify () |
Notify is used to indicate to the Iterate that one of the data objects it had requested has been granted. | |
int | notifications () const |
How many notifications remain? | |
void | addNotification () |
int & | generation () |
int & | togo () |
int | affinity () const |
There is no such thing in serial. | |
int | hintAffinity () const |
void | affinity (int) |
void | hintAffinity (int) |
Protected Attributes | |
IterateScheduler< SerialAsync > & | scheduler_m |
What scheduler are we working with? | |
int | notifications_m |
How many notifications should we receive before we can run? | |
int | generation_m |
Which generation we were issued in. | |
int | togo_m |
How many times we need to go past a "did something" to be ready for destruction? | |
Friends | |
class | IterateScheduler< SerialAsync > |
class | DataObject< SerialAsync > |
An Iterate is a non-blocking unit of concurrency that is used to describe a chunk of work. It inherits from the Runnable class and as all subclasses of Runnable, the user specializes the run() method to specify the operation. Iterate<SerialAsync> is a further specialization of the Iterate class to use the SerialAsync Scheduling algorithm to generate the data dependency graph for a data-driven execution.
typedef DataObject<SerialAsync> Smarts::Iterate< SerialAsync >::DataObject_t |
typedef IterateScheduler<SerialAsync> Smarts::Iterate< SerialAsync >::IterateScheduler_t |
Smarts::Iterate< SerialAsync >::Iterate | ( | IterateScheduler< SerialAsync > & | s, | |
int | affinity = -1 | |||
) | [inline] |
The Constructor for this class takes the IterateScheduler and a CPU affinity.
CPU affinity has a default value of -1 which means it may run on any CPU available.
virtual Smarts::Iterate< SerialAsync >::~Iterate | ( | ) | [inline, virtual] |
The dtor is virtual because the subclasses will need to add to it.
virtual void Smarts::Iterate< SerialAsync >::run | ( | ) | [pure virtual] |
The run method does the core work of the Iterate.
It is supplied by the subclass.
Reimplemented from Smarts::Runnable.
int Smarts::Iterate< SerialAsync >::affinity | ( | ) | const [inline] |
There is no such thing in serial.
int Smarts::Iterate< SerialAsync >::hintAffinity | ( | ) | const [inline] |
void Smarts::Iterate< SerialAsync >::affinity | ( | int | ) | [inline] |
void Smarts::Iterate< SerialAsync >::hintAffinity | ( | int | ) | [inline] |
void Smarts::Iterate< SerialAsync >::notify | ( | ) | [inline] |
Notify is used to indicate to the Iterate that one of the data objects it had requested has been granted.
To do this, we dec a dependence counter which, if equal to 0, the Iterate is ready for execution.
References Smarts::add().
Referenced by Smarts::IterateScheduler< SerialAsync >::handOff(), and Smarts::DataObject< SerialAsync >::request().
int Smarts::Iterate< SerialAsync >::notifications | ( | ) | const [inline] |
How many notifications remain?
void Smarts::Iterate< SerialAsync >::addNotification | ( | ) | [inline] |
int& Smarts::Iterate< SerialAsync >::generation | ( | ) | [inline] |
Referenced by Smarts::IterateScheduler< SerialAsync >::handOff().
int& Smarts::Iterate< SerialAsync >::togo | ( | ) | [inline] |
Referenced by Smarts::SystemContext::runSomething().
friend class IterateScheduler< SerialAsync > [friend] |
friend class DataObject< SerialAsync > [friend] |
IterateScheduler<SerialAsync>& Smarts::Iterate< SerialAsync >::scheduler_m [protected] |
What scheduler are we working with?
int Smarts::Iterate< SerialAsync >::notifications_m [protected] |
How many notifications should we receive before we can run?
Referenced by Smarts::DataObject< SerialAsync >::request().
int Smarts::Iterate< SerialAsync >::generation_m [protected] |
Which generation we were issued in.
int Smarts::Iterate< SerialAsync >::togo_m [protected] |
How many times we need to go past a "did something" to be ready for destruction?