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

Consider the following set of processes, with the length of the CPU burst time g

ID: 439959 • Letter: C

Question

Consider the following set of processes, with the length of the CPU burst time given in milliseconds:Process Burst Time Priority P1 10 3 P2 1 1 P3 2 3 P4 1 4 P5 5 2 The processes are assumed to have arrived in the order P1,P2,P3,P4,P5, all at time 0. a) Draw 3 Gantt charts illustrating the execution of these processes using FCFS, non-preemptive SJF, and non-preemptive priority (a smaller priority number equals a higher priority) scheduling. b) What is the turnaround time of each process for each of the scheduling algorithms in part a? Show your work. c) What is the waiting time of each process for each of the scheduling algorithms in part a? Show your work. d) Which if the schedules in part a) results in the minimal average waiting time (over all processes)?

Explanation / Answer

FCFS: |P1 |P2|P3 |P4|P5 | 0 10 11 13 14 19 SJF: |P2|P4|P3 |P5 |P1 | 0 1 2 4 9 19 NPP: |p2|P5 |P1 |P3 |P4| 0 1 6 16 18 19 RR: |P1|P2|P3|P4|P5|P1|P3|P5| 0 1 2 3 4 5 6 7 8 |P1|P5|P1|P5|P1|P5|P1 | 8 9 10 11 12 13 14 19 FCFS: P1: 10ms, P2: 11ms, P3: 13ms, P4: 14ms, P5: 19ms SJF: P1: 19ms, P2: 1ms, P3: 4ms, P4: 2ms, P5: 9ms NPP: P1: 16ms, P2: 1ms, P3: 18ms, P4: 19ms, P5: 6ms RR: P1: 19ms, P2: 2ms, P3: 7ms, P4: 4ms, P5: 14ms FCFS: P1: 0ms, P2: 10ms, P3: 11ms, P4: 13ms, P5: 14ms SJF: P1: 9ms, P2: 0ms, P3: 2ms, P4: 1ms, P5: 4ms NPP: P1: 6ms, P2: 0ms, P3: 16ms, P4: 18ms, P5: 1ms RR: P1: 9ms, P2: 1ms, P3: 5ms, P4: 3ms, P5: 9ms FCFS: 48/5 = 9.6ms SJF: 16/5 = 3.2ms NPP: 41/5 = 8.2ms RR: 27/5 = 5.4ms Shortest Job First is the winner.