Consider a CPU that has to execute two types of processes. The first type,…

2026

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 𝑡 = 10, 20, 30, 40, and 50 (in seconds). Similarly, a new process of type C arrives at time 𝑡 = 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 𝑡 = 10 seconds. The average waiting time (in seconds) for the 10 processes is ___________. (rounded off to one decimal place)

Attempted by 26 students.

Show answer & explanation

Correct answer: 9.5

Step-by-Step Solution

We need to calculate the waiting time for each of the 10 processes using the First Come First Serve (FCFS) scheduling policy. Waiting Time = Start Time - Arrival Time.

Process Timeline Analysis

1. Process A1: Arrives at 10s. Starts at 10s. Burst = 6s. Finishes at 16s. Waiting Time = 10 - 10 = 0s.

2. Process C1: Arrives at 11s. CPU is busy with A1 until 16s. Starts at 16s. Burst = 8s. Finishes at 24s. Waiting Time = 16 - 11 = 5s.

3. Process A2: Arrives at 20s. CPU is busy with C1 until 24s. Starts at 24s. Burst = 6s. Finishes at 30s. Waiting Time = 24 - 20 = 4s.

4. Process C2: Arrives at 22s. CPU is busy with A2 until 30s. Starts at 30s. Burst = 8s. Finishes at 38s. Waiting Time = 30 - 22 = 8s.

5. Process A3: Arrives at 30s. CPU is busy with C2 until 38s. Starts at 38s. Burst = 6s. Finishes at 44s. Waiting Time = 38 - 30 = 8s.

6. Process C3: Arrives at 33s. CPU is busy with A3 until 44s. Starts at 44s. Burst = 8s. Finishes at 52s. Waiting Time = 44 - 33 = 11s.

7. Process A4: Arrives at 40s. CPU is busy with C3 until 52s. Starts at 52s. Burst = 6s. Finishes at 58s. Waiting Time = 52 - 40 = 12s.

8. Process C4: Arrives at 44s. CPU is busy with A4 until 58s. Starts at 58s. Burst = 8s. Finishes at 66s. Waiting Time = 58 - 44 = 14s.

9. Process A5: Arrives at 50s. CPU is busy with C4 until 66s. Starts at 66s. Burst = 6s. Finishes at 72s. Waiting Time = 66 - 50 = 16s.

10. Process C5: Arrives at 55s. CPU is busy with A5 until 72s. Starts at 72s. Burst = 8s. Finishes at 80s. Waiting Time = 72 - 55 = 17s.

Calculation of Average Waiting Time

Sum of Waiting Times = 0 + 5 + 4 + 8 + 8 + 11 + 12 + 14 + 16 + 17 = 95 seconds.

Total number of processes = 10.

Average Waiting Time = Total Waiting Time / Total Processes = 95 / 10 = 9.5 seconds.

The average waiting time is 9.5 seconds.

Explore the full course: Gate Guidance By Sanchit Sir