All 1. ProcessesConsider Arrivalthe Timefollowing =0. Iset finishedof thisprocesses, onwith mythe paper.length Areof theythe right?CPU burst and given in milliseconds: Process Time Burst Priority p1 P1 0 4 3 p2 P2 0 7 2 p3 P3 0 2 6 p4 P4 0 5 1 p5 P5 0 4 2 WT BT Gannt|-Chart---------------------- |-------------------------| AT FCFS CT |----------------------TAT-----------------------| The p4processes are |assumed p5to have arrived |in p2the order P1, P2, P3, |P4, p1P5 all |p2at |time 0. a.) Draw four Gantt chars that illustrate the execution of these processes using the following scheduling algorithms: FCFS, SJF, Non-preemptive Priority (a smaller priority number implies a higher priority), and RR (quantum=2). b.) What is the turnaround time of each process for each of the scheduling algorithms in part a? c.) What is the waiting time of each process for each of these scheduling algorithms? Process Time Burst Priority P1 0 4 3 P2 0 7 2 P3 0 2 6 P4 0 5 9 1 P5 16 20 22 0 4 2 Complete Time = CT Turn Around Time = TAT Burst Time = BT Wait Time (= WT) Average Wait Time = (0+5+9+16+20)/5AWT WT = 50TAT /- 5BT TAT = 10CT m- AT Since they all arrived at time 0 but in order of P1, P2, P3, P4 P5.s We run at P1 first down to P5 in order on FCFS disregarding the Priority I think I got a lot of wrong here since I was not paying attention. Gannt CT-ChartAT TAT-BT SJF Process AT Burst Priority CT TAT WT |p1 p4 | p5 0 | 4 3 4 4 0 p2 | p10 |p2 | 7 2 11 11 4 p3 0 2 5 9 6 1613 20 2213 11 Waitp4 Time (WT) = (0+5+9+16+20)/5 = 500 / 5 = 10 m.s 1 18 18 13 p5 0 4 2 22 22 18 Gannt-Chart - Non-preemptive PriorityFCFS | p4p1 | p5p2 | p2p3 | p4 | p1 p5 |p2 | 0 54 11 9 13 16 18 20 22 AverageNeeds Waita Timelot (of corrections below: AWT) = (0+5+9+16+200+4+11+13+18)/5 = 5046 / 5 = 10 m9.s 2 ms RoundTAT Robin= (Quantum=24+11+13+18+22)/5 = 68/5=13.6 ms |p4|p5|p2|p1|p3|p4|p5|p2|p1|P4|p2|p2|****************** 0 Gannt-SJF 1. 2Sort all 4the processes 6in increasing 8order according 10to 12burst 14time. 16 2. 18Then 19simply, 21apply 22FCFS. P4There 5-2-2-1-1=0 p5is a tie between P1 and P5 because Burst is 4-2 so two Gannt-2=0Chart p2 P1 7-2-2-2-1=0first | p3 | p1 4-2-2=0 | p5 | p4 | p2 | p30 2-2=0 Average Wait Time (AWT) 6 10 15 22 p4 AWT = 0+(10-2)+(18-120+2+6+10+15)/5 =14= 33/5 = 6.6 ms p5 TAT = 2+(12-42+6+10+15+22)=10/5 =55/5= 11 ms P5 first | p3 | p5 | p1 | p4 | p2 =| 0 4+(14- 2 6)+(19-16)=15 10 15 22 p1 AWT = 6+(16-80+2+6+10+15)=14 p3/5 = 833/5 = 6.6 ms AVTTAT = (14+10+15+14+82+6+10+15+22)/5=5 9= m.s55/5 = 11 ms ***************** Alternate orGannt-Chart possible- GannNon-Chartpreemptive forPriority 1. FCFSSort andall Prioritythe Non-Preemptiveprocesses withoutin Pickingincreasing BTorder first.according to priority Gannt-Chart2. -Then simply, apply FCFS. There is a tie between p2 and p5 because priority is 2. p2 first | p4 | p2 | p5 | p1 |p2| p3 | 0 5 12 12 16 20 22 Average Wait Time ( 22 AWT) = (0+5+12+16+20)/5 = 5310.6 ms TAT =(5+12+16+20+22) /5 = 75/5 =15 ms p5 first | p4 | p5 | p2 | p1 | p3 | 0 5 9 16 20 22 AWT = (0+5+9+16+20)/5 = 10.6 mms TAT = (5+9+16+20+22)/5 = 14.s4 ms ************************* Gannt-Chart -Round PriorityRobin Non-Preemptive(Quantum=2) | |p1 p4 |p2 ||p3 p2 |p4 |p5 ||p1 p5 |p2 |p4 |p5 |P2 |p4 | p1 |p2p2 | 0 2 5 4 6 8 10 12 14 16 18 20 22 Average Wait21 Time ( 22 AWT) = (0+5+12+16+208+15+4+16+14)/5 = 5311.4 ms TAT = (12+22+6+21+18)/5= 79 / 54 = 1015.68 m.sms