- LPU MCA Semester 1
- CAP366
- Unit 4
CAP366 · Unit 4: CPU scheduling
Types of scheduling and scheduling criteria
12 practice questions · in the MTE and ETE syllabus
Key points
- Preemptive vs non-preemptive decision points
- Maximise utilisation and throughput
- WT = TAT - BT; TAT = CT - AT
- Response = first CPU time - arrival
Scheduling decisions occur when a process (1) goes Running to Waiting, (2) Running to Ready, (3) Waiting to Ready, (4) terminates. A non-preemptive scheme schedules only in cases 1 and 4; a preemptive scheme may also act in cases 2 and 3.
Criteria: maximise CPU utilisation and throughput; minimise turnaround, waiting and response time.
| Measure | Formula |
|---|---|
| Turnaround time | Completion time - arrival time |
| Waiting time | Turnaround - burst (no I/O) |
| Response time | First CPU time - arrival time |
Example: arrival 2, burst 6, completion 15 gives turnaround 13, waiting 7.
Exam pitfall: under FCFS with no preemption and no I/O, response time equals waiting time, but for round robin they usually differ. Interactive systems care most about response time.
Try two questions
Which pair of criteria should a CPU scheduler try to maximise?
- CPU utilisation and throughput
- Waiting time and response time
- Turnaround time and waiting time
- Throughput and turnaround time
Show the answer
A. Utilisation and throughput are maximised, while turnaround, waiting and response time are minimised.
Why not B: These are to be minimised, since lower values are better.
Why not C: Both are to be minimised.
Why not D: Turnaround time is minimised, so it does not belong with throughput here.
Each process spends 70 percent of its time waiting for I/O, and the system keeps 3 such processes in memory at once. What is the approximate CPU utilisation?
- 30.0%
- 34.3%
- 65.7%
- 90.0%
Show the answer
C. The CPU is idle only if all 3 wait, which has probability 0.7^3 = 0.343, so utilisation is 1 - 0.343 = 65.7 percent.
Why not A: This is the utilisation with only one process in memory.
Why not B: This is the probability that all three are computing, not the CPU use.
Why not D: This adds 30 percent three times, which ignores overlap of the waits.