OS ch6
OS ch6
Basic Concepts
Scheduling Criteria
Scheduling Algorithms
Multiple-Processor Scheduling
Real-Time Scheduling
Algorithm Evaluation
P1 P2 P3
0 24 27 30
Waiting time for P1 = 0; P2 = 24; P3 = 27
Average waiting time: (0 + 24 + 27)/3 = 17
P2 P3 P1
0 3 6 30
0 3 7 8 12 16
P1 P2 P3 P2 P4 P1
0 2 4 5 7 11 16
P1 P2 P3 P4 P1 P3 P4 P1 P3 P3
Dispatch latency – time it takes for the dispatcher to stop one process and
start another running.
The conflict phase of dispatch latency has two components:
1. Preemption of any process running in the kernel
2. Release by low-priority processes resources needed by the high-priority process
Operating System Concepts 6.28 Silberschatz, Galvin and Gagne 2002
Algorithm Evaluation
How do we select a CPU-scheduling algorithm for a particular system? .
The first problem is defining the criteria to be used in selecting an algorithm.
Criteria are often defined in terms of CPU utilization, response time, or
throughput.
To select an algorithm, we must first define the relative importance of these
measures. Our criteria may include several measures, such as:
Maximize CPU utilization under the constraint that the maximum response time is
1 second.
Maximize throughput such that turnaround time is (on average) linearly
proportional to total execution time.
Once the selection criteria have been defined, we want to evaluate the
various algorithms under consideration.