Page 79 - DCAP403_Operating System
P. 79
Operating System
Notes Figure 5.1: CPU Scheduling
swap in partially executed swap out
swapped-out processes
ready queue CPU end
I/O waiting
I/O queues
Task Differentiate between uniprocessor and multi-processor.
Scheduling Mechanisms
A multiprogramming operating system allows more than one process to be loaded into
the executable memory at a time and for the loaded process to share the CPU using
time-multiplexing. Part of the reason for using multiprogramming is that the operating system
itself is implemented as one or more processes, so there must be a way for the operating system
and application processes to share the CPU. Another main reason is the need for processes to
perform I/O operations in the normal course of computation. Since I/O operations ordinarily
require orders of magnitude more time to complete than do CPU instructions, multiprograming
systems allocate the CPU to another process whenever a process invokes an I/O operation.
Goals for Scheduling
Make sure your scheduling strategy is good enough with the following criteria:
1. Utilization/Effi ciency: keep the CPU busy 100% of the time with useful work
2. Throughput: maximize the number of jobs processed per hour.
3. Turnaround time: from the time of submission to the time of completion, minimize the time
batch users must wait for output
4. Waiting time: Sum of times spent in ready queue - Minimize this
5. Response Time: time from submission till the first response is produced, minimize response
time for interactive users
6. Fairness: make sure each process gets a fair share of the CPU
72 LOVELY PROFESSIONAL UNIVERSITY