DUECA/DUSIME
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Static Public Attributes | Friends | List of all members
dueca::PrioritySpec Class Reference

Priority specification. More...

#include <PrioritySpec.hxx>

Inheritance diagram for dueca::PrioritySpec:
Inheritance graph
[legend]
Collaboration diagram for dueca::PrioritySpec:
Collaboration graph
[legend]

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 chargetTypeName ()
 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 ParameterTablegetParameterTable ()
 Obtain a pointer to the parameter table.
 

Static Public Attributes

static const charclassname
 For printing error messages.
 

Friends

std::ostream & operator<< (std::ostream &os, const PrioritySpec &)
 Print to stream, for debugging.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ PrioritySpec()

dueca::PrioritySpec::PrioritySpec ( int priority,
int order )

Complete constructor.

Parameters
priorityselection of priority (thread) the activity will run in. Priority 0 is the lowest priority, the highest is user-configurable.
orderrelative 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.

Member Function Documentation

◆ getPriority()

int dueca::PrioritySpec::getPriority ( ) const
inline

This class is scheme callable, this macro defines all necessary Scheme stuff.

Return the priority.


The documentation for this class was generated from the following file: