0% found this document useful (0 votes)
362 views3 pages

First Come First Serve Problems

The document contains 5 problems demonstrating the first come first serve non-preemptive scheduling algorithm. Each problem shows the processes, their burst times, and the resulting Gantt chart, waiting times, turnaround times, and average waiting and turnaround times.

Uploaded by

ANJAN
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
362 views3 pages

First Come First Serve Problems

The document contains 5 problems demonstrating the first come first serve non-preemptive scheduling algorithm. Each problem shows the processes, their burst times, and the resulting Gantt chart, waiting times, turnaround times, and average waiting and turnaround times.

Uploaded by

ANJAN
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

First Come First Serve Non-Preemptive

1st Problem
Process Burst Time
P1 3
P2 6
P3 4
P4 2
Gantt chart
P1 P2 P3 P4
0 3 9 13 15
Waiting Time
P1=0
P2=3
P3=9
P4=13
Average Waiting Time= 0+3+9+13 = 25 = 6.25ms
4 4
Turnaround time
P1=0+3=3
P2=3+6=9
P3=9+4=13
P4=13+2=15
Average Turnaround Time = 3+9+13+15 = 40 =10ms
4 4

2nd Problem
Process Burst Time
P1 10
P2 1
P3 2
P4 1
P5 5

Gantt chart
P1 P2 P3 P4 P5
0 10 11 13 14 19
Waiting Time
P1=0
P2=10
P3=11
P4=13
P5=14
Average Waiting Time =0+10+11+13+14= 48 = 9.6ms
5 5
Turnaround Time
P1=0+10=10
P2=10+1=11
P3=11+2=13
P4=13+1=14
P5=14+5=19
Average Turnaround Time= 10+11+13+14+19 = 67 = 13.4ms
5 5

3rd Problem

Process Burst time Arrival time


P1 8 0
P2 4 1
P3 9 2
P4 5 3

Gantt chart
P1 P2 P3 P4
0 8 12 21 26
Waiting Time
P1=0-0=0
P2=8-1=7
P3=12-2=10
P4=21-3=18
Average Waiting Time = 0+7+10+18= 35 =8.75ms
4 4
Turnaround Time
P1=0+8=8
P2=7+4=11
P3=10+9=19
P4=18+5=23
Average Turnaround Time= 8+11+19+23 = 61 = 15.25ms
4 4
4th Problem(Jan 2015 QP)

Process CPU Burst AT


P1 10 0
P2 29 1
P3 03 2
P4 07 3

Gantt chart
P1 P2 P3 P4
0 10 39 42 49

Waiting Time
P1=0-0=0
P2=10-1=9
P3=39-2=37
P4=42-3=39

Avg WT= 0+9+37+39 = 85 = 21.25ms


4 4
Turnaround Time
P1=0+10=10
P2=9+29=38
P3=37+3=40
P4=39+7=46

Avg TAT = 10+38+40+46 = 134 = 33.5ms


4 4

5th Problem

Process AT BT
P1 0 8
P2 0.4 4
P3 1.0 1

Gantt chart
P1 P2 P3
0 8 12 13
Waiting Time (WT=WT-AT)
P1=0-0=0
P2=8-0.4=7.6
P3=12-1.0=11

Avg WT = 0+7.6+11 = 18.6 = 6.2ms


3 3
Turnaround Time = BT+WT
P1=8+0=8
P2=4+7.6=11.6
P3=1+11=12
Avg TAT = 8+11.6+12 = 31.6 = 10.53ms
3 3

You might also like