For the following set of processes scheduled using FCFS policy, determine the average waiting time. Assume that the processes arrived in the order P1, P2, P3, P4.
| Process | Burst Time (ms) |
|---|---|
| P1 | 8 |
| P2 | 15 |
| P3 | 10 |
| P4 | 7 |
Pick an option to check yourself, or open the answer below.
Show answer & explanation
Correct answer: B. 16
Explanation
Under FCFS with all processes effectively ready together and served strictly in arrival order P1-P2-P3-P4, each process's completion time is the running sum of burst times: P1 completes at 8, P2 at 8+15=23, P3 at 23+10=33, P4 at 33+7=40. Waiting time = completion time − burst time (since arrival time is 0 for all): P1 = 8−8 = 0, P2 = 23−15 = 8, P3 = 33−10 = 23, P4 = 40−7 = 33. Average waiting time = (0+8+23+33)/4 = 64/4 = 16 ms, option (ii), illustrating the convoy effect where later processes wait behind every longer job ahead of them.More Discrete Structures and Optimization questions
- Which of the following statements are true? (A) Shortest remaining time first scheduling may cause starvation. (B) Preemptive scheduling ma…
- An OS follows round robin scheduling with a time quantum of 4 ms. Assuming that the CPU is free now and there are 20 processes waiting in t…
- If an operating system does not allow a child process to exist when the parent process has been terminated, this phenomenon is called:
- Consider the following 3 processes, with the length of the CPU burst time given in milliseconds: Process Arrival Time Burst Time P1 0 8 P2…
- Assuming that the system call fork() never fails, consider the following C programs P1 and P2 executed on a UNIX/Linux system. P1 P2 int ma…
- Consider the following four processes with the arrival time and length of CPU burst given in milliseconds: Process Arrival Time Burst Time…