1. (20 pts) Consider the following set of processes, with the length of the CPU
ID: 3735710 • Letter: 1
Question
1. (20 pts) Consider the following set of processes, with the length of the CPU burst time given in milliseconds: Process P1 P2 P3 P4 PS Burst Time Pririty 3 4 4 The processes are assumed to have arrived in the order P1, P2, P3, P4, P5, all at time 0. Use a software to draw four Gantt charts that illustrate the execution of these processes using the following scheduling algorithms: FCFS, nonpreemptive SJF, nonpreemptive priority (a larger priority number implies a higher priority), and RR (quantum 2), and calculate the average waiting time for each algorithm. Hand drawing is not acceptedExplanation / Answer
PRIORITY
SCHEDULE
FCFS --------- Average waiting time = 31/5 =6.2
0 2 3 11 15 20
SJF-----------Average waiting time = 23/5 = 4.6
0 1 3 7 12 20
Priority scheduling--------------Average waiting time =55/5 = 11
0 8 13 15 19 20
RR(TQ=2)-----------Average waiting time = 36/5 = 7.2
0 2 3 5 7 9 11 13 15 17 18 20
FCFS FCFS N SJF N SJF PRIORITY SCHEDULEPRIORITY
SCHEDULE
RR RR process Burst time Priority CT WT CT WT CT WT CT WT P1 2 3 2 0 3 1 15 13 2 0 P2 1 1 3 2 1 0 20 19 3 2 P3 8 5 11 3 20 12 8 0 20 12 P4 4 2 15 11 7 3 19 15 13 9 P5 5 4 20 15 12 7 13 8 18 13 TOTAL 31 23 55 36Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.