Download Salvo User Manual

Transcript
rarely use taskIDs when writing your Salvo application. Instead,
Salvo uses pointers as handles to tasks. For example, the pointer to
the task with taskID 3 is OSTCBP(3).
Does it matter which taskID I assign to a particular task?
No. The only rule to follow is that each task needs its own, unique
taskID, and hence its own, unique tcb. A task's priority is independent of its taskID.
Is there an idle task in Salvo?
Salvo has a built-in facility for automatically calling a user-defined
function when the system is idling. OSIdlingHook() is enabled via
the configuration option OSENABLE_IDLING_HOOK.
If you prefer, you can create your own idle task with the lowest
possible priority (OSLOWEST_PRIO). Be sure that no other tasks
have this priority. Then, your idle task will run whenever none of
the other tasks are eligible.
You can context-switch inside an idle task of your own making,
but you cannot context-switch inside the built-in idling hook function. This is an important distinction. Which one you use will depend on what sort of functionality you want to occur when the
system is idling. The scheduler must perform a context switch each
time the idle task runs. Overall performance is better when using
the idling hook function, since no real context switch is performed
when calling OSIdlingHook().
How can I monitor the tasks in my application?
Salvo provides a task monitor function that you can link to your
application. The monitor is intended to work with a simple ASCII
terminal program. The monitor can display the status of all tasks
and events, and can control tasks. See OSRpt() for more information.
What exactly happens in the scheduler?
Salvo's scheduler OSSched() performs three major functions each
time it is called. First, it processes the event queue, if events are in
use. This means that for every event that had a waiting task when it
Salvo User Manual
Chapter 6 • Frequently Asked Questions (FAQ)
215