User`s guide
Tasks
Thread Scheduling 4-45
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
equals TSK_MAXPRI, the task execution effectively locks out all other
program activity except for the handling of hardware interrupts and software
interrupts.
During the course of a program, each task’s mode of execution can change
for a number of reasons. Figure 4-13 shows how execution modes change.
Figure 4-13. Execution Mode Variations
Functions in the TSK, SEM, and SIO modules alter the execution state of task
objects: blocking or terminating the currently running task, readying a
previously suspended task, re-scheduling the current task, and so forth.
There is one task whose execution mode is TSK_RUNNING. If all program
tasks are blocked and no hardware or software interrupt is running, TSK
executes the TSK_idle task, whose priority is lower than all other tasks in the
system. When a task is preempted by a software or hardware interrupt, the
task execution mode returned for that task by TSK_stat is still
TSK_RUNNING because the task will run when the preemption ends.
TSK_TERMINATED
TSK_create()
task is created
TSK_BLOCKED
TSK_READY
TSK_yield(),
preemption
TSK_tick(),
SEM_post()
task is readied
TSK_RUNNING
task suspends
TSK_sleep(),...
SEM_pend(),...
task exits
TSK_exit()
TSK_delete()
task is deleted
TSK_delete()
task is deleted










