Upload
francis-barker
View
212
Download
0
Embed Size (px)
Citation preview
Exercise (4)
Exercise
• Assume the following jobs are executed with one processor, with the jobs arriving in the order listed in the table.– Suppose a system uses FCFS scheduling. Create a Gantt
chart illustrating these processes.
– What is the turnaround time for process p3?
– What is the average waiting time for processes?
– How about Shortest-Job-Next (SJN) scheduling?
2
i (pi)
0 80
1 20
2 10
3 20
4 50
3
p1 p2 p3
Avg. waiting time of FCFS is:
i (pi)
0 80
1 20
2 10
3 20
4 50
p0
p4
0
Avg. waiting time of SJN is:
0
FCFS:
SJN:
Turnaround time of process p3 with FCFS:
Turnaround time of process p3 with SJN: