Coma FW-C2800 User's Guide Page 113

  • Download
  • Add to my manuals
  • Print
  • Page
    / 276
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 112
Overview of Thread Scheduling
4-8
4.1.5 Yielding and Preemption
The DSP/BIOS schedulers run the highest-priority thread that is ready to run
except in the following cases:
The thread that is running disables some or all hardware interrupts
temporarily (with HWI_disable or HWI_enter), preventing hardware ISRs
from running.
The thread that is running disables software interrupts temporarily (with
SWI_disable). This prevents any higher-priority software interrupt from
preempting the current thread. It does not prevent hardware interrupts
from preempting the current thread.
The thread that is running disables task scheduling temporarily (with
TSK_disable). This prevents any higher-priority task from preempting the
current task. It does not prevent software and hardware interrupts from
preempting the current task.
The highest-priority thread is a task that is blocked. This occurs if the task
calls TSK_sleep, LCK_pend, MBX_pend, or SEM_pend.
Both hardware and software interrupts can interact with the DSP/BIOS task
scheduler. When a task is blocked, it is often because the task is pending on
a semaphore which is unavailable. Semaphores can be posted from HWIs
and SWIs as well as from other tasks. If an HWI or SWI posts a semaphore
to unblock a pending task, the processor switches to that task if that task has
a higher priority than the currently running task.
When running either an HWI or SWI, DSP/BIOS uses a dedicated system
interrupt stack, called the system stack. Each task uses its own private stack.
Therefore, if there are no TSK tasks in the system, all threads share the same
system stack. Because DSP/BIOS uses separate stacks for each task, both
the application and task stacks can be smaller. Because the system stack is
smaller, you can place it in precious fast memory.
Table 4-2 shows what happens when one type of thread is running (top row)
and another thread becomes ready to run (left column). The results depend
on whether or not the type of thread that is ready to run is enabled or disabled.
(The action shown is that of the thread that is ready to run.)
Page view 112
1 2 ... 108 109 110 111 112 113 114 115 116 117 118 ... 275 276

Comments to this Manuals

No comments