Operating Systems · Unit 4
CPU Scheduling
Exam-focused notes for CPU Scheduling (Operating Systems, BIT204): what the TU syllabus asks and how it has actually been tested, with 4 solved past questions from this unit.
What this unit covers
- Scheduling objectives and criteria
- FIFO scheduling algorithm
- Shortest Job First scheduling
- Priority scheduling
- Round Robin scheduling
- Turnaround time calculation
- Waiting time calculation
- Multiple queue scheduling
Turnaround time calculation
CPU Scheduling Analysis
Find Average waiting time and turn-around time for the following example using FIFO, SRTF and Round Robin scheduling algorithm. Assume quantum as 4 ms.
| Process id | Arrival time | Burst time (ms) |
|---|---|---|
| P1 | 0 | 8 |
| P2 | 1 | 5 |
| P3 | 1 | 10 |
| P4 | 2 | 13 |
| P5 | 2 | 17 |
[10]
Process Arrival Time Burst Time ---------------------------------- P1 0 8 P2 1 5 P3 1 10 P4 2 13 P5 2 17 Quantum $q = 4$ ms. Formulas: TAT = CT - AT, WT = TAT - BT. --- Order by arrival: P1 → P2 → P3 → P4 → P5. Gantt: P1[0-8] P2[8-13] P3[13-23] P4[23-36] P5...
Full solved answer →Round Robin scheduling
CPU Scheduling Analysis
Consider the following set of processes, with the length of CPU burst time given in milliseconds. The processes are assumed to have arrived in the order A, B, C and D all at time 0. What is the turnaround time and waiting time for the scheduling algorithms, RR (quantum = 3) and Priority Algorithm.
| Process | CPU Burst | Priority |
|---|---|---|
| A | 8 | 3 |
| B | 9 | 1 (Lowest) |
| C | 10 | 2 |
| D | 6 | 4 (Highest) |
[5]
Process CPU Burst Priority ------------------------------ A 8 3 B 9 1 (Lowest) C 10 2 D 6 4 (Highest) All arrive at time 0, in order A, B, C, D. Formulas: $TAT = CT - AT$, $WT = TAT - Burst$. --- Ready queue starts: A, B, C, D. A process that still has rema...
Full solved answer →CPU Scheduling Analysis
Consider the following set of processes, with the length of CPU burst time given in milliseconds.
| Processes | CPU Burst | Priority |
|---|---|---|
| A | 8 | 3 |
| B | 13 | 1 (Lowest) |
| C | 19 | 2 |
| D | 3 | 4 (Highest) |
The processes are assumed to have arrived in the order A, B, C and D all at time 0. What is the turnaround time and waiting time for the scheduling algorithms, RR (quantum = 5) and Priority Algorithm?
[5]
Process CPU Burst (ms) Priority ----------------------------------- A 8 3 B 13 1 (Lowest) C 19 2 D 3 4 (Highest) Arrival: all at time 0, order A, B, C, D. Total burst = $8+13+19+3 = 43$ ms. --- Ready queue starts A, B, C, D. Track remaining bursts. Slot Pro...
Full solved answer →Multiple queue scheduling
Why do we need multiple queues in process scheduling? What is the significance of TLB? [5]
--- A single queue for all processes is inefficient because processes have different characteristics, priorities, and resource requirements. Multiple queues address this by organizing processes into separate categories. 1. Different Process Priorities - Hig...
Full solved answer →Make Unit 4 stick
Practice BIT204 with flashcards & quizzes