Use app×
Join Bloom Tuition
One on One Online Tuition
JEE MAIN 2025 Foundation Course
NEET 2025 Foundation Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
2.2k views
in Computer by (103k points)
closed by

Consider 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


1. 6.5 ms
2. 7.5 ms 
3. 6.75 ms
4. 7.75 ms

1 Answer

0 votes
by (106k points)
selected by
 
Best answer
Correct Answer - Option 1 : 6.5 ms

The 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.

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...