- 2074 Bhadra · 6 marks
FCFS, SJF, RR Gantt and turnaround
Short answer
FCFS mean turnaround time =58, SJF =37, Round Robin (q=5) =53 time units.
Suppose 5 processes are submitted at time 0.
| Process | A | B | C | D | E |
|---|---|---|---|---|---|
| Burst Time | 35 | 10 | 15 | 5 | 20 |
| Priority | 3 | 2 | 4 | 5 | 1 |
| Show the execution timeline of the processes using Gantt Chart for FCFS, SJF and Round Robin (q=5). Also calculate mean turnaround time in each case. |
All five processes arrive at time 0, so turnaround time = completion time and waiting time = turnaround − burst. The priority row is not needed for these three algorithms.
FCFS
| A | B | C | D | E |
0 35 45 60 65 85
| Process | Arrival | Burst | Completion | Turnaround | Waiting |
|---|---|---|---|---|---|
| A | 0 | 35 | 35 | 35 | 0 |
| B | 0 | 10 | 45 | 45 | 35 |
| C | 0 | 15 | 60 | 60 | 45 |
| D | 0 | 5 | 65 | 65 | 60 |
| E | 0 | 20 | 85 | 85 | 65 |
Average waiting time = 205/5 = 41; average turnaround time = 290/5 = 58
SJF (non-preemptive; shortest burst first)
| D | B | C | E | A |
0 5 15 30 50 85
| Process | Arrival | Burst | Completion | Turnaround | Waiting |
|---|---|---|---|---|---|
| A | 0 | 35 | 85 | 85 | 50 |
| B | 0 | 10 | 15 | 15 | 5 |
| C | 0 | 15 | 30 | 30 | 15 |
| D | 0 | 5 | 5 | 5 | 0 |
| E | 0 | 20 | 50 | 50 | 30 |
Average waiting time = 100/5 = 20; average turnaround time = 185/5 = 37
Round Robin (q = 5)
| A | B | C | D | E | A | B | C | E | A | C | E | A |
0 5 10 15 20 25 30 35 40 45 50 55 60 65
| E | A |
65 70 85
| Process | Arrival | Burst | Completion | Turnaround | Waiting |
|---|---|---|---|---|---|
| A | 0 | 35 | 85 | 85 | 50 |
| B | 0 | 10 | 35 | 35 | 25 |
| C | 0 | 15 | 55 | 55 | 40 |
| D | 0 | 5 | 20 | 20 | 15 |
| E | 0 | 20 | 70 | 70 | 50 |
Average waiting time = 180/5 = 36; average turnaround time = 265/5 = 53
Mean turnaround time
| Algorithm | Mean turnaround time |
|---|---|
| FCFS | 58 |
| SJF | 37 |
| Round Robin (q=5) | 53 |
Answer: FCFS = 58, SJF = 37, RR (q=5) = 53 time units. SJF is best; FCFS is worst because the long process A comes first.
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- FCFS, SJF, Priority, RR Gantt; max AWT · Operating System, chapter 2
- Avg turnaround: FCFS, RR, SJF, SRT, HRRN · Operating System, chapter 2
- RR, preemptive priority, preemptive SJF · Operating System, chapter 2
- CPU criteria; RR Gantt and times · Operating System, chapter 2
- Preemptive priority and SRTF Gantt · Operating System, chapter 2
- Two processors: priority and RR (q=3) · Operating System, chapter 2
- Round robin scheduling (9, 6, 3 ms, q=2) · Embedded System, chapter 6 · asked 4×
- Round robin scheduling (6, 4, 2 ms, q=2) · Embedded System, chapter 6 · asked 4×
- CPU free percentage with I/O (round robin) · Embedded System, chapter 6
- Round robin scheduling (9, 6, 3 ms, q=3) · Embedded System, chapter 6 · asked 4×