In: Computer Science
There are 4 processes with different arrival time and service time.
Process |
Arrival |
Service |
A |
0 |
10 |
B |
3 |
4 |
C |
5 |
6 |
D |
7 |
2 |
a. Use FCFS, RR(4), SPN, SRT, and HRRN to schedule them. Calculate
the waiting time and turnaround time for each process and the
average turnaround time for each algorithm.
b. Compare all the 5 algorithms. Considering the overhead time for each scheduling takes 1 time unit, which is the best? If the overhead takes 4 time units, which is the best?
a)
FCFS:
TAT=51Waiting time=29
gnatt chart:
RR(4):
TAT=53
waiting time:31
SPN:
waiting time=23
TAT=45
SRT:
TAT=38
WT=16
HRRN:
TAT=49
WT=27
b)when overhead =1
according
to when overhead=1
average waiting times are:
FCFS-9.75
RR(4)-11.5
SPN-8.25
SRT-7.5
HRRN-8.75
SO Least waiting time is SRT. so SRT is best.
when overhead =4
average waiting times are:
FCFS-17.25
RR(4)-25.75
SPN-15.75
SRT-11.75
HRRN-15.75
SO Least waiting time is SRT. so SRT is best.