Professional Documents
Culture Documents
1) FCFS (First Come First Search)
1) FCFS (First Come First Search)
Gantt chart
P3 P1 P4 P5 P2
0 12 22 25 27 35
we know that,
Turn around time = Completion time- arrival time
Waiting time=turn around time - burst time
Process Completion Waiting Time Turn around time
Time
P1 22 21 - 10 = 11 22 - 1=21
P2 35 30 - 8 = 22 35 - 5=30
P3 12 12 - 12 = 0 12 - 0=12
P4 25 23 - 3 = 20 25 - 2=23
P5 27 23 - 2 = 21 27- 4=23
2)SJF scheduling:
Process Completion Waiting Time Turn around time
Time
P1 24 23 - 10=13 24 - 1=23
P2 15 10 - 8=2 15 - 5=10
P3 35 35 - 12=23 35 - 0=35
P4 5 3 - 3=0 5 - 2=3
P5 7 3 - 2=1 7 - 4=3
3)PRIORITY Scheduling
1 10 13 12 2
5 8 21 16 8
0 12 32 32 20
2 3 35 33 30
4 2 6 2 0
avg=19 avg=12
average waiting time= (2+8+20+30)/5 = 60/5=12
average turn around time= (12+16+32+33+2)/5 =95/5=19
4)Round Robin :
Gantt chart:
P3 P1 P4 P5 P3 P2 P1 P3 P2 P1
0 4 8 11 13 17 21
25 29 33 35
Process Completion Waiting Time Turn around time
Time
P1 35 34-10=24 35-1=34
P2 33 28-8=20 33-35=28
P3 29 29-12=17 29-0=29
P4 11 9-3=6 11-2=9
P5 13 9-2=7 13-4=9