24-11-2012, 03:18 PM
CPU Scheduling
lecture_9_cpuscheduling.ppt (Size: 2.58 MB / Downloads: 180)
Scheduling queues
CPU schedulers use various queues in the scheduling process:
Job queue: consists of all processes
All jobs (processes), once submitted, are in the job queue.
Some processes cannot be executed (e.g. not in memory).
Ready queue
All processes that are ready and waiting for execution are in the ready queue.
Usually, a long-term scheduler/job scheduler selects processes from the job queue to the ready queue.
CPU scheduler/short-term scheduler selects a process from the ready queue for execution.
Simple systems may not have a long-term job scheduler
Performance metrics for CPU scheduling
CPU utilization: percentage of the time that CPU is busy.
Throughput: the number of processes completed per unit time
Turnaround time: the interval from the time of submission of a process to the time of completion.
Wait time: the sum of the periods spent waiting in the ready queue
Response time: the time of submission to the time the first response is produced
Which metric is used more?
CPU utilization
Trivial in a single CPU system
Fairness
Tricky, even definition is non-trivial
Throughput, turnaround time, wait time, and response time
Can usually be computed for a given scenario.
They may not be more important than fairness, but they are more tractable than fairness.
Deterministic modeling example
Suppose we have processes A, B, and C, submitted at time 0
We want to know the response time, waiting time, and turnaround time of process A