Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1. The following table shows a sample process workload: Process Burst Time Prior

ID: 3846519 • Letter: 1

Question

1. The following table shows a sample process workload: Process Burst Time Priority Arrival Time P1 50 ms 0 ms P2 20 ms 1 20 ms 100 ms L P3 40 ms P4 40 ms 2 60 ms The following is an example time line using the FCFS scheduling algorithm for the sample process workload shown above (1 unit 10 ms): P1 IPI P1 PI P1 P2 P2 P3 P3 P3 P3 P3 P3 P3 P3 P3 LP3I P4 P4 P4 P4 0 123 5 6 8 9 10 11 12 13 14 15 16 17 18 19 20 Answer the following questions: a. What is the average waiting time for FCFS based on the time line shown above?

Explanation / Answer

1.

FCFS

Average Waiting time = ((0-0)+(50-20)+(70-40)+(170-60))/4 = (0+30+30+110)/4 = 42.5 ms

2.

i) SRJF

Average Waiting time = (0+(20-20)+(110-40)+(70-60))/4 = (0+0+70+10)/4 = 80/4 = 20 ms

ii) Non Preemptive priority

0---1---2---3---4---5---6---7---8---9---10--11--12---13---14---15---16--17---18---19---20----21

Average Waiting time = (0 + (50-20)+(110-40)+(70-60))/4 = (30 +70+10)/4 = 110/4 = 27.5 ms

iii) Round Robin (Quantum = 30 ms)

Average Waiting Time = ((0-0)+(30-20)+(50-40)+(80-60))/4 = (0+10+10+20)/4 = 40/4 = 10ms

P1 P1 P2 P2 P1 P1 P1 P4 P4 P4 P4 P3 P3 P3 P3 P3 P3 P3 P3 P3 P3