Next: , Previous: IDS declaration, Up: Input file format


5.6 Task declaration

 (18) task                  ::= "task" identifier opt-properties ";"
 (26) opt-properties        ::= [ "{" properties "}" ]
 (27) properties            ::= { property }

 (19) task-property         ::= ( "period" const-expr time-unit | "delay"
                                const-expr time-unit | "priority"
                                positive-int-const | "scheduling" "real-time" |
                                "stack" positive-int-const size-unit ) ";"
 (30) codel-property        ::= opt-async "codel" ( codel ";" | fsm-codel ";" )

Tasks define an execution context suitable for running activities (see Component declaration). A task may define a state machine and associated codels (see Codel declaration). The state machine starts in the start state when the task is created during component initialization.

Tasks are named can also define the following properties:

period
The granularity of the codel scheduler. Periodic task will sequence the codels they manage at that frequency.
delay
The delay from the beginning of each period after which codels are run. This can be used to delay two tasks running at the same period in the same component.
priority
Can be used to prioritize different tasks whithin the same component.
scheduling real-time
This indicates that the task requires real-time scheduling. This may not be supported by all templates.
stack
Defines the required stack size for this task. The stack size should be big enough to run all codels that the task manages.