Question:

Consider the following set of processes with the length of the CPU burst time given in milliseconds:
CPU Burst
The processes are assumed to have arrived in order P1, P2, P3, P4, P5 all at time 0. What is the waiting time of process P4 for Shortest Job First (SJF), non-preemptive priority scheduling, and Round Robin (Quantum=1) scheduling algorithms respectively?

Show Hint

For scheduling algorithms, focus on the execution order and keep track of the time slices or priorities to calculate waiting times.
Updated On: Dec 29, 2024
  • 18, 3, 1
  • 3, 1, 18
  • 18, 3, 3
  • 1, 3, 18
Hide Solution
collegedunia
Verified By Collegedunia

The Correct Option is A

Solution and Explanation

1. Shortest Job First (SJF): Execution order: P2, P4, P3, P5, P1. P4 starts after P2, so its waiting time = 18 ms. 2. Non-preemptive Priority Scheduling: Priority order: P2, P5, P3, P1, P4. P4 starts after all higher-priority processes, so its waiting time = 3 ms. 3. Round Robin (Quantum = 1): Round-robin execution: P1, P2, P3, P4, P5 (time slices). P4’s first time slice occurs after all processes get their first turn, so its waiting time = 1 ms.
Was this answer helpful?
0
0

Questions Asked in CUET PG exam

View More Questions