Question:

Consider a CPU that has to execute two types of processes. The first type, Actuators (A), requires a CPU burst of 6 seconds. The second type, Controllers (C), requires a CPU burst of 8 seconds. A new process of type A arrives at time \(t = 10, 20, 30, 40,\) and \(50\) (in seconds). Similarly, a new process of type C arrives at time \(t = 11, 22, 33, 44,\) and \(55\) (in seconds). The CPU scheduling policy is First Come First Serve (FCFS). The first process of type A starts running at \(t = 10\) seconds. The average waiting time (in seconds) for the 10 processes is ___________.
(Rounded off to one decimal place)

Show Hint

List all 10 arrivals in one combined, arrival-sorted timeline and simulate the single CPU: a process starts at max(its arrival time, the CPU's previous finish time).
Updated On: Jul 22, 2026
Show Solution
collegedunia
Verified By Collegedunia

Correct Answer: 9.5

Solution and Explanation

Step 1 (Concept): Under FCFS, processes are served strictly in order of arrival on a single, non-preemptive CPU: once a process starts it runs to completion before the next one (by arrival order) can start. Waiting time of a process = (time it actually starts) - (its arrival time).

Step 2 (Combined arrival timeline, sorted by arrival time): A1@10(burst 6), C1@11(burst 8), A2@20(burst 6), C2@22(burst 8), A3@30(burst 6), C3@33(burst 8), A4@40(burst 6), C4@44(burst 8), A5@50(burst 6), C5@55(burst 8).

Step 3 (Simulate the CPU, always serving the earliest-arrived process still waiting when the CPU frees up):
A1: starts at 10 (CPU idle). Wait = 10 - 10 = 0. Finishes at 16.
C1: starts at 16 (only one waiting). Wait = 16 - 11 = 5. Finishes at 24.
A2: starts at 24 (A2 arrived 20, earlier than C2 at 22... wait, A2 at 20 is earlier than C2 at 22, so A2 goes first). Wait = 24 - 20 = 4. Finishes at 30.
C2: starts at 30 (C2 arrived 22, earlier than A3 at 30). Wait = 30 - 22 = 8. Finishes at 38.
A3: starts at 38 (A3 arrived 30, earlier than C3 at 33... note A3 arrived at 30 which is before C3's 33, so A3 goes first). Wait = 38 - 30 = 8. Finishes at 44.
C3: starts at 44 (C3 arrived 33, earliest among waiting: C3(33), A4(40), C4(44)). Wait = 44 - 33 = 11. Finishes at 52.
A4: starts at 52 (A4 arrived 40, earliest among waiting: A4(40), C4(44), A5(50)). Wait = 52 - 40 = 12. Finishes at 58.
C4: starts at 58 (C4 arrived 44, earliest among waiting: C4(44), A5(50), C5(55)). Wait = 58 - 44 = 14. Finishes at 66.
A5: starts at 66 (A5 arrived 50, earlier than C5 at 55). Wait = 66 - 50 = 16. Finishes at 72.
C5: starts at 72 (only one left). Wait = 72 - 55 = 17. Finishes at 80.

Step 4 (Sum the waiting times): 0 + 5 + 4 + 8 + 8 + 11 + 12 + 14 + 16 + 17 = 95.

Step 5 (Average): Average waiting time = 95 / 10 = 9.5 seconds.

\[ \boxed{9.5} \]
Was this answer helpful?
2
0

Top GATE CS Operating System Questions

View More Questions