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: 3854727 • 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.

Draw four Gantt charts illustrating the execution of these processes using FCFS, SJF, a non-preemptive priority (a smaller priority number implies a higher priority), and RR (quantum = 1) scheduling.

What is the turnaround time of each process for each of the scheduling algorithms in part a?

What is the waiting time of each of process for each of the scheduling algorithms in part a?

Explanation / Answer

FCFS

0-------------------10------------------11---------------------13--------------------14--------------------19

Turnaround time :

P1 = 10,P2 = 11,P3 = 13,P4 = 14, P5 = 19

Waiting time :

P1 = 0,P2 = 10,P3 = 11,P4 = 13,P5 = 14

SJF

0-------------------1------------------2---------------------4-------------------------9----------------------19

Turnaround time :

P1 = 19,P2 = 1,P3 = 4,P4 = 2, P5 = 9

Waiting time :

P1 = 9,P2 = 0,P3 = 2,P4 = 1,P5 = 4

NON-PREEMPTIVE PRIORITY

0-------------------1------------------6---------------------16--------------------18-------------------19

Turnaround time :

P1 = 16,P2 = 1,P3 = 18,P4 = 19, P5 = 6

Waiting time :

P1 = 6,P2 = 0,P3 = 16,P4 = 18,P5 = 1

ROUND ROBIN(QUANTUM = 1)

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

Turnaound Time:

P1 = 19, P2 = 2, P3 = 7, P4 = 4, P5 = 14

Waiting Time :

P1 = 9, P2 = 1, P3 = 5, P4 = 3, P5 = 9

P1 P2 P3 P4 P5