Texas Instruments TMS320 User Manual page 145

Dsp/bios v5.40
Hide thumbs Also See for TMS320:
Table of Contents

Advertisement

4.4.2
Task Execution States and Scheduling
The default configuration template defines the TSK_idle task which must
have the lowest priority. It runs the functions defined for the IDL objects when
no higher-priority task or interrupt is ready.
Note:
DSP/BIOS splits the specified stack space equally between user (data)
stack memory and system stack memory.
When you configure tasks to have equal priority, they are scheduled in the
order in which they are created in the configuration script. Tasks can have up
to 16 priority levels. The highest level is 15 and the lowest is 0. The priority
level of 0 is reserved for the system idle task. You cannot sort tasks within a
single priority level by setting the order property.
If you want a task to be initially suspended, set its priority to -1. Such tasks
are not scheduled to run until their priority is raised at run-time.
Each TSK task object is always in one of four possible states of execution:
1) Running, which means the task is the one actually executing on the
system's processor;
2) Ready, which means the task is scheduled for execution subject to
processor availability;
3) Blocked, which means the task cannot execute until a particular event
occurs within the system; or
4) Terminated, which means the task is "terminated" and does not execute
again.
Tasks are scheduled for execution according to a priority level assigned to the
application. There can be no more than one running task. As a rule, no ready
task has a priority level greater than that of the currently running task, since
TSK preempts the running task in favor of the higher-priority ready task.
Unlike many time-sharing operating systems that give each task its "fair
share" of the processor, DSP/BIOS immediately preempts the current task
whenever a task of higher priority becomes ready to run.
The maximum priority level is TSK_MAXPRI (15); the minimum priority is
TSK_MINPRI (1). If the priority is less than 0, the task is barred from further
execution until its priority is raised at a later time by another task. If the priority
Thread Scheduling
Tasks
4-41

Advertisement

Table of Contents
loading

Table of Contents