edited by
6,957 views
3 votes
3 votes

There are three processes in the ready queue. When the currently running process requests for I/O how many process switches take place?

  1. 1
  2. 2
  3. 3
  4. 4
edited by

7 Answers

Best answer
8 votes
8 votes

First Given that currently running process requests for IO so First switch will occur from running state to block state .Now run state is empty we can schedule another process so another process will be scheduled from ready state to running state.

But anyhow this is one context switch to store the state of old process and restore the saved state of new process.

Alternative:

Two.  In  the  first  switch,  the  process   to  be  switched  is  taken  out  and  the  scheduler starts executing. Then the next process is brought to execution. So there are two process switches.

Reference:http://nptel.ac.in/courses/106108101/pdf/Worked_Out_Problems/Mod_3.pdf.

So option B is correct.

selected by
5 votes
5 votes

According to me now , on learning and focussing the points of vivek the answer is one . one context switch takes.

saving one process context and then loading the another process context and then running it . its all in one context switch.

now if u can understand then i may define it in the way we have read till now. 

in the grant chat how many context switch does we count if we switch one process and select another process. only one . if this question is taking two context switch then we must have to take 2 context switch between p1 and p2 . one to push it in the wait/ suspended . and second to put p1 in running state that is not happening . so answer is one. 

thanks vivek for asking again and again. 

2 votes
2 votes

I THINK 

2 process switches occur . 

2 votes
2 votes

One.

The currently running process will be sent in blocked state and a process from ready queue will come in.

edited by
Answer:

Related questions

6 votes
6 votes
1 answer
1
go_editor asked Jun 24, 2016
5,543 views
In a system using single processor, a new process arrives at the rate of six processes per minute and each such process requires seven seconds of service time. What is th...
7 votes
7 votes
4 answers
4
go_editor asked Jun 22, 2016
6,388 views
Consider a 32-bit machine where four-level paging scheme is used. If the hit ratio to TLB is 98%, and it takes 20 nanosecond to search the TLB and 100 nanoseconds to acce...