Consider the available processes given below in the ready queue for execution and with given burst time.
| Process No | Arrival Time | Burst time |
|---|---|---|
| P1 | 1 | 3 |
| P2 | 2 | 4 |
| P3 | 3 | 2 |
| P4 | 4 | 4 |
a) What is the time at which all the processes get executed?
b) Find the average turnaround time using the non-pre-emptive FCFS scheduling algorithm.
You're viewing a preview — the full solution, concept, methods & PYQ mapping are locked.
Start your 14-day free trial to unlock the full solution →Concept understanding — FCFS Scheduling Average Waiting Time
FCFS Scheduling: Average Waiting Time
Imagine you're at a single counter — a railway ticket window, a bank teller, a canteen. People arrive, form a queue, and are served one by one in the exact order they arrived. No cutting in line. No priority. That is First-Come, First-Served (FCFS) scheduling, also called FIFO (First-In, First-Out).
In an operating system, the "people" are processes (programs in execution), and the "counter" is the CPU. Each process needs a certain amount of CPU time — its burst time. The scheduler simply picks the process that arrived earliest and runs it to completion before touching the next one.
The Intuition Behind Waiting Time
A process doesn't start running the moment it arrives. It has to wait until every process that arrived before it finishes. So the waiting time of a process is the total time it spends sitting in the ready queue, not getting any CPU.
For the very first process to arrive, waiting time is zero — it gets the CPU immediately. The second process waits for the first to finish. The third waits for the first and second to finish, and so on.
Waiting time does not include the time the process itself spends running. It's only the idle time before its turn.
The Precise Calculation
Given a list of processes with their arrival times and burst times, here is the step-by-step method:
-
Completion Time (CT) — when a process finishes execution.
For the first process:
For every subsequent process:
-
Turnaround Time (TAT) — total time from arrival to completion.
-
Waiting Time (WT) — turnaround time minus burst time.
-
Average Waiting Time — the mean of all waiting times.
Worked Example (All Arrive at Time 0)
Suppose three processes arrive together at time 0:
| Process | Burst Time |
|---|---|
| P1 | 6 |
| P2 | 8 |
| P3 | 4 |
Since all arrive at 0, the order is P1 → P2 → P3.
-
P1: starts at 0, finishes at 6.
(or simply: it starts immediately, so wait = 0)
-
P2: starts at 6, finishes at 14.
-
P3: starts at 14, finishes at 18.
Average waiting time: units.
Worked Example (Different Arrival Times)
Now consider processes arriving at different times:
| Process | Arrival Time | Burst Time |
|---|---|---|
| P1 | 0 | 5 |
| P2 | 2 | 3 |
| P3 | 4 | 2 |
Step-by-step: …
Unlock everything free for 14 days
- Full step-by-step solutions
- Concept-first explanations
- Methods, shortcuts & mistakes
- PYQ mapping + timed mock tests
Full access for 14 days. No credit card required.