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
237 views
in Computer by (85.8k points)
closed by

Three CPU-bound tasks, with execution times of 15, 12 and 5 time units respectively arrive at times 0, t and 8, respectively. If the operating system implements a shortest remaining time first scheduling algorithm, what should be the value of t to have 4 context switches?

Ignore the context switches at time 0 and at the end.
1. 0 < t < 3
2. t = 0
3. t < = 3
4. 3 < t < 8

1 Answer

0 votes
by (96.5k points)
selected by
 
Best answer
Correct Answer - Option 1 : 0 < t < 3

Process scheduling Algorithm: shortest remaining time first scheduling

Process Table:

Process

Arrival Time

Burst Time

P0

0

15

P1

t

12

P2

8

5

 

Gantt Chart:

At t = 0:

P1

P1

P2

P0

0           8            12          17          32

                           1st              2nd 

2 context switches occur. Hence Option 2  and 3 is eliminated.

At t = 1:

P0

P1

P2

P1

P0

0           1            8           13           18         32

              1st        2nd         3rd          4th   

4 context switches occur.

Since P2 and P1 has the same burst time we can choose any process at t = 8

At t = 2:

P0

P1

P2

P1

P0

0           2            8           13           19          32

             1st         2nd         3rd          4th  

4 context switches occur.

At = 5:

P0

P0

P2

P0

P1

0           5            8           13           20          32

                           1st         2nd          3rd  

Only 3 context switches occur. Hence Option 4 is also eliminated.

Therefore, option 1 is the correct answer

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

...