|
DUECA/DUSIME
|
Priority specification. More...
#include <PrioritySpec.hxx>


Public Member Functions | |
| PrioritySpec () | |
| Constructor. | |
| PrioritySpec (int priority, int order) | |
| Complete constructor. | |
| bool | complete () |
| Complete method, called after constructor and supply of parameters, has to check the validity of the parameters. | |
| const char * | getTypeName () |
| Type name information. | |
| virtual | ~PrioritySpec () |
| Destructor. | |
| int | getPriority () const |
| This class is scheme callable, this macro defines all necessary Scheme stuff. | |
| int | getOrder () const |
| Return the order. | |
Static Public Member Functions | |
| static const ParameterTable * | getParameterTable () |
| Obtain a pointer to the parameter table. | |
Static Public Attributes | |
| static const char * | classname |
| For printing error messages. | |
Friends | |
| std::ostream & | operator<< (std::ostream &os, const PrioritySpec &) |
| Print to stream, for debugging. | |
Priority specification.
DUECA usually runs with several threads. A PrioritySpec defines in which thread an activity will run, and how important the activity is relative to other activities in that same thread. Priority 0 is the administrative priority, this is also the priority that runs any (if present) graphics libraries. The highest priority is configurable in the dueca.cnf file.
A PrioritySpec is normally used to specify the priority of a module. It can be constructed from scheme with the following call:
dueca.PrioritySpec(<integer>,
<integer>).param(
priority = <integer>,
# Priority level, >= 0, determines the thread in which, and the
# ActivityManager by which, an activity is run
order = <integer>,
# Determines relative importance of activities in one prio level
# a smaller number means to come first, a larger one comes later.
# Logical time of an activity also plays a role. A difference of 100 in
# order is equivalent to one time granule.
)
'''Description:
Defines the priority of an Activity'''
Where prio is the priority, and thus the selection for a thread, and order specifies the relative importance within that thread. The higher the order, the more important the activity with respect to other activities in the same thread.
| dueca::PrioritySpec::PrioritySpec | ( | int | priority, |
| int | order ) |
Complete constructor.
| priority | selection of priority (thread) the activity will run in. Priority 0 is the lowest priority, the highest is user-configurable. |
| order | relative importance to other activities in the same thread or priority. This may be a negative number. Higher means more important. At the same time, activities become more important as they are older. With currently selected parameters, a difference of 100 in order is equal to 1 integer time step. |
|
inline |
This class is scheme callable, this macro defines all necessary Scheme stuff.
Return the priority.