Question
Download Solution PDFConsider the following table of arrival time and burst time for three processes P0, P1, P2:
Process | arrival time | Burst time |
P0 | 0 ms | 7 |
P1 | 1 ms | 3 |
P2 | 2 ms | 7 |
The pre-emptive shortest job first scheduling algorithm is used. Scheduling is carried out only at arrival or completion of a process. What is the average waiting time for the three processes?
Answer (Detailed Solution Below)
Detailed Solution
Download Solution PDFThe correct answer is 3.67 ms
Key PointsIn Shortest Job First (SJF) scheduling, the process with the smallest burst time is processed next. In Preemptive SJF, if a new process arrives with CPU burst length less than remaining time of current executing process, CPU is preempted, and that new process starts execution.
Gantt chart
Process | arrival time | Burst time | Waiting time |
P0 | 0 ms | 7 | 3 |
P1 | 1 ms | 3 | 0 |
P2 | 2 ms | 7 | 8 |
So, the average waiting time is:
(3ms + 0ms + 8ms) / 3 = 3.67ms (rounded to nearest hundredth)
So, the average waiting time for the processes under a preemptive SJF scheduling algorithm is approximately 3.67ms.
Last updated on Jun 6, 2025
-> The UGC NET Exam Schedule 2025 for June has been released on its official website.
-> The UGC NET Application Correction Window 2025 is available from 14th May to 15th May 2025.
-> The UGC NET 2025 online application form submission closed on 12th May 2025.
-> The June 2025 Exam will be conducted from 21st June to 30th 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.