-
Notifications
You must be signed in to change notification settings - Fork 274
Scheduling
In Trampoline schedulable objects are tasks and Interrupt Service Routines (ISR). ISRs are activated by an IRQ while tasks may be activated by another task, a message arrival or an alarm.
OSEK/VDX OS defined two kinds of task: basic tasks and extended tasks.
A basic tasks is a sequential computing that must finish in a finite time. So no infinite loop may take place in a basic task. A basic task my be in 3 states (see picture below):
- SUSPENDED: the task is not activated and is not known to the scheduler;
- READY: the task is ready to execute and wait to be started by the scheduler;
- RUNNING: the task is executing. Once activated, a task is managed by the scheduler until its termination.
The following picture show how a task goes from one state to another. Dashed transitions are done by the scheduler. Solid transitions are done by the application.
Unlike a basic task, an extended task may wait for an event, the only blocking system call. The body of an extended task is typically built with a loop where a wait for one or many events takes place followed by the corresponding processing. From the operating system point of view, a new state, WAITING, is added to the state diagram of tasks. A task in the WAITING state is not known to the scheduler. The following picture shows the states of an extended task.