4 Cpu Scheduling

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

208010 marks

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 idArrival timeBurst time (ms)
P108
P215
P3110
P4213
P5217

[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

20785 marks

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.

ProcessCPU BurstPriority
A83
B91 (Lowest)
C102
D64 (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 →
05 marks

CPU Scheduling Analysis

Consider the following set of processes, with the length of CPU burst time given in milliseconds.

ProcessesCPU BurstPriority
A83
B131 (Lowest)
C192
D34 (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

05 marks

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 →