in Operating System edited by
4,087 views
4 votes
4 votes

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$
in Operating System edited by
by
4.1k views

4 Comments

A option is correct as at t=2 we get the 4 context switches and at t=5 we get the 3 context switches at t=0 its eliminated hence opt A is correct
0
0
At t=3 as well we get 4 context switches, the how is A correct?
1
1
no at t=3 there are 3 context switching
0
0

2 Answers

6 votes
6 votes
P1 comes at 0 and executes till t now look at the burst times for the process p1 and p2  so for a context switch to take place burst time for p2 has to be less than p1 12<15-t , t<3 so t value can be anything between 0 to 3 option A is the correct answer

1 comment

At    t=0 , there there are only 3 context switches

So only at  t=2. Is correct answer.

Which is option (a) 0 < t<3
0
0
1 vote
1 vote

Also fails at t = 0. at t=0,context switches=3 Option B,C eliminated.

 

But at t = 2, we get 4 context switches. So, Option A

Answer:

Related questions