ProcessorScheduler implements a round-robin with priorities scheduler. In other words, a running process will hold the CPU until one of the following occurs:
• It performs an operation that causes it to suspend (see Table 7 for a list of the primary operations that cause a process to suspend).1. systemBackgroundPriority2. userBackgroundPriority3. userSchedulingPriority4. userInterruptPriority5. lowIOPriority6. highIOPriority7. timingPriorityOn many platforms the priorities are actually mapped to the integers 1 through 7; however, it is poor programming style to reference the priorities directly as integral values. The preferred approach is to use the priority accessors provided by ProcessorScheduler. You can query a process priority and modify its value as required. In the next example, the priority and priority: messages are used to query and modify the priority of the process. Note, however, that if a priority is changed, the change has no effect on scheduling until the next process switch.
|