13.07.2015 Views

iAPX 286 Operating System Writers Guide 1983

iAPX 286 Operating System Writers Guide 1983

iAPX 286 Operating System Writers Guide 1983

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

TASK MANAGEMENTSCHEDULING POLICIESThe actual implementation of scheduling policies depends on the needs of the application and thebehavior of the tasks in the system. Consider a simple policy that• Gives all tasks equal priority• Allocates the processor once to each task in turn• Allocates the same maximum time-slot to each taskEven this seemingly "fair" policy actually favors certain tasks over others. A task that frequentlyrelinquishes the processor voluntarily (because, for example, it frequently has to wait for I/O) rarelyuses the full time-slot. A "processor-bound" task (for example, a computational task that uses manyinstructions to accomplish its purpose but rarely does I/O), on the other hand, almost always uses thefull time-slot, forcing the operating system to preempt it. Over a period of many time-slots, processorboundtasks will receive much more attention from the processor than I/O-bound tasks. Whether thissituation is desirable depends on the roles of the tasks in the application.Attempting to discriminate against processor-bound tasks by introducing a priority mechanism canresult in different problems. Suppose all I/O-bound tasks have higher priority than all processor-boundtasks. At the end of a time-slice or when a task voluntarily gives up the processor, the scheduler switchesto one of the higher-priority tasks if one is ready; if none is ready, it switches to one of the lowerprioritytasks. The problem occurs when there is a such a number of I/O-bound tasks that at least oneof them is always ready. In this case, the lower-priority, processor-bound tasks never execute.Many more scheduling policies than those outlined here are possible. The examples given merely illustratehow important it is that the characteristics of the tasks in the system be known and that thepolicies match those characteristics. Refer to Coffman and Denning (see "External Literature" in thePreface) for a survey of these and other policies.Structuring Task InformationIf your operating system is to manipulate tasks efficiently, you must structure task-related informationso that the operating system can get the information it needs as quickly as the application requires.The processor implements part of this structure through interlocking links in the GDT, LDT, and TSS.In addition to this structure, the operating system must deal with additional state information, whichmight include• The data-segment alias to the task's LDT• The data-segment alias to the task's TSS• Scheduling state• Scheduling parameters (for example, time-slice, priority)• Scheduling statistics (for example, total processor time used, average time-slice used, expectedrunning time)• Links for queues of waiting and ready tasks4-10 121960-001

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!