Question:

Consider the following sets of processes, with the length of CPU burst time given in milliseconds: \(\begin{array}{|c|c|c|} \hline \text{Process} & \text{Burst Time (ms)} & \text{Priority} \\ \hline P_1 & 8 & 4 \\ P_2 & 6 & 1 \\ P_3 & 1 & 2 \\ P_4 & 9 & 2 \\ P_5 & 3 & 3 \\ \hline \end{array}\)
 The processes are assumed to have arrived in the order \( P_1, P_2, P_3, P_4, P_5 \) all at time 0. 
Calculate the average waiting time of each process using FCFS scheduling.

Show Hint

The FCFS scheduling algorithm computes the waiting time as: \[ \text{WT} = \text{Turnaround Time} - \text{Burst Time} \] \text{For sequential execution, each process waits for the sum of previous burst times.}
Updated On: Feb 6, 2025
  • 13.1 ms
  • 15.5 ms
  • 16.4 ms
  • 12.2 ms
Hide Solution
collegedunia
Verified By Collegedunia

The Correct Option is D

Solution and Explanation


Step 1: Understanding First-Come, First-Served (FCFS) Scheduling 
- FCFS is a non-preemptive scheduling algorithm where processes execute in the order they arrive.
- The waiting time (WT) for each process is calculated as: \[ WT = \text{Turnaround Time} - \text{Burst Time} \] 
Step 2: Computing Completion and Waiting Times The execution order is \( P_1, P_2, P_3, P_4, P_5 \). 

\[\begin{array}{|c|c|c|c|} \hline \text{Process} & \text{Burst Time} & \text{Completion Time} & \text{Waiting Time} \\ \hline P_1 & 8 & 8 & 0 \\ P_2 & 6 & 14 & 8 \\ P_3 & 1 & 15 & 14 \\ P_4 & 9 & 24 & 15\\  P_5 & 3 & 27 & 24 \\ \hline \end{array}\]


Step 3: Calculating Average Waiting Time \[ \text{Average WT} = \frac{(0 + 8 + 14 + 15 + 24)}{5} \] \[ = \frac{61}{5} = 12.2 \text{ ms} \] 
Step 4: Evaluating options:
- (A) Incorrect: 13.1 ms is an overestimation.
- (B) Incorrect: 15.5 ms is incorrect.
- (C) Incorrect: 16.4 ms is incorrect.
- (D) Correct: \( 12.2 \) ms matches the computed result.

Was this answer helpful?
0
0