Question
Download Solution PDFConsider the following four processes with the arrival time and length of CPU burst given in milliseconds :
Process | Arrival Time | Burst Time |
P1 | 0 | 8 |
P2 | 1 | 4 |
P3 | 2 | 9 |
P4 | 3 | 5 |
The average waiting time for preemptive SJF scheduling algorithm is
Answer (Detailed Solution Below)
Detailed Solution
Download Solution PDFThe correct answer is option 1.
CONCEPT:
Shortest Job First:
In the SJF scheduling algorithm, the process with the lowest burst time, among the list of available processes in the ready queue, is going to be scheduled next. Preemptive SJF scheduling is the shortest remaining time first
Formula:
TAT=CT-AT
WT=TAT-BT
Gantt Chart:
P1 | P2 | P4 | P1 |
P3 |
0 1 5 10 17 26
Process | Arrival Time(AT) | Burst Time(BT) | Completion Time(CT) | TAT=CT-AT | WT=TAT-BT |
P1 | 0 | 8 | 17 | 17 | 9 |
P2 | 1 | 4 | 5 | 4 | 0 |
P3 | 2 | 9 | 26 | 24 | 15 |
P4 | 3 | 5 | 10 | 7 | 2 |
Average waiting time= \(\frac{(9+0+15+2) }{4}\)=6.5
∴ Hence the correct answer is 6.5.
Last updated on Jun 12, 2025
-> The UGC NET June 2025 exam will be conducted from 25th to 29th June 2025.
-> The UGC-NET exam takes place for 85 subjects, to determine the eligibility for 'Junior Research Fellowship’ and ‘Assistant Professor’ posts, as well as for PhD. admissions.
-> The exam is conducted bi-annually - in June and December cycles.
-> The exam comprises two papers - Paper I and Paper II. Paper I consists of 50 questions and Paper II consists of 100 questions.
-> The candidates who are preparing for the exam can check the UGC NET Previous Year Papers and UGC NET Test Series to boost their preparations.