Download VisualDSP++ Kernel (VDK) User's Guide
Transcript
Signals If a thread calls PostSemaphore() from within an unscheduled region, where the scheduler is disabled, the highest-priority thread moved to the ready queue runs (see Figure 4-5). Thread Domain/Unscheduled Region PostSemaphore() Ready Queue Order threads by priority, then FIFO Semaphore's List of Pending Threads Order by priority, then FIFO ... ... ... Thread 1 Thread 1 runs Block The highest-priority thread Figure 4-5. Thread Domain/Unscheduled Region: Posting a Semaphore Posting from the Interrupt Domain. Interrupt subroutines can also post semaphores. Figure 4-6 illustrates the process of posting a semaphore from the interrupt domain. Interrupt Domain 1). RTI Ready Queue Order threads by priority, then FIFO VDK_ISR_POST_SEMAPHORE_() 2). The low-priority ISR runs 3). Scheduler runs 1). Set the low-priority ISR 2). Invoke Scheduler ISR 1 ISR 2 The highest-priorityThread thread Highest-Priority ISR 3 1). Switch out the interrupted thread Yes The interrupted thread runs Is the interrupted thread of the highest priority? No Figure 4-6. Interrupt Domain: Posting a Semaphore 4-20 VisualDSP++ Kernel (VDK) User’s Guide 2). Switch in the highestpriority pending thread