Back to the 2024 paper

Module 2: Processes & Scheduling

20247m

Consider the following set of processes with the length of the CPU Burst given in milliseconds:

Process Burst Time Priority
A 10 3
B 1 1
C 2 3
D 1 4
E 5 2

The processes are assumed to have arrived in order A, B, C, D, E all at time 0.
Draw the Gantt charts that illustrate the execution of FCFS and SJF scheduling algorithm. Show which algorithm results in the minimum average waiting time.

Worked SolutionAI Assisted

FCFS vs SJF for A(10),B(1),C(2),D(1),E(5) arrival 0

FCFS order A,B,C,D,E: Gantt A0-10,B10-11,C11-13,D13-14,E14-19. WT: A0,B10,C11,D13,E14 => Avg WT=9.6, Avg TAT=13.4
SJF (non-preemptive, sorted by burst): order B(1),D(1),C(2),E(5),A(10): Gantt B0-1,D1-2,C2-4,E4-9,A9-19. WT: B0,D1,C2,E4,A9 => Avg WT=3.2, Avg TAT=7.0
Conclusion: SJF gives minimum avg waiting (3.2 vs 9.6). SJF is optimal for avg WT.

Similar questions

Operating SystemConsider the following set of processes with the length of the CPU burst given in milliseconds: | Process | Burst Time | Priority | | :---: | :---: | :---: | | A | 10 | 3 | | B | 1 | 1 | | C | 2 | 3 | | D | 1 | 4 | | E | 5 | 2 | The processes are assumed to have arrived in order A, B, C, D, E all at time 0. Draw the Gantt charts that illustrate the execution of SJF scheduling algorithm. Show which algorithm results in the minimum average waiting time.20257mOPERATING SYSTEMFive batch jobs, A through E, arrive at a computer center at essentially the same time. They have an estimated running time of 15, 9, 3, 6 and 12 minutes, respectively. Their (externally defined) priorities are 6, 3, 7, 9 and 4, respectively, with a lower value corresponding to a higher priority. For each of the following scheduling algorithms, determine the waiting time for each process and the average waiting for all jobs. Ignore process switching overhead. Explain how you arrived at your answers. In the last three cases, assume that only one job at a time runs until it finishes and that all jobs are completely processor bound: (a) Priority scheduling (b) FCFS (run in order 15, 9, 3, 6 and 12) (c) Shortest job first202214mOperating SystemConsider the following CPU processes with arrival times 0 and CPU bursts (in milliseconds) as given below: | Process | Burst time | |---|---| | P1 | 24 | | P2 | 3 | | P3 | 3 | If the Round Robin Scheduling is used with time quantum of 4 milliseconds to schedule the processes. Draw the Gantt chart and calculate the average waiting time across all processes (in milliseconds).20227mOperating SystemConsider the following process : | Process | Arrival Time | Burst Time | | :--- | :--- | :--- | | P1 | 0.0 | 7 | | P2 | 2.0 | 4 | | P3 | 4.0 | 1 | | P4 | 5.0 | 4 | Considering non-preemptive and preemptive SJF algorithm, find out average waiting time and average turnaround time in both cases.201914m
Budget AppAndroid App

Pocketly on Android

Log daily food, travel, and hostel expenses instantly. Set monthly spending limits and see where your money goes without complex spreadsheets.