555 views
0 votes
0 votes

 Please read below passage from 10th edition Operating System Concepts, pg. 202:

5.1.3 Preemptive and Nonpreemptive Scheduling

CPU-scheduling decisions may take place under the following four circumstances:

  1. When a process switches from the running state to the waiting state (for example, as the result of an I/O request or an invocation of wait() for the termination of a child process)
  2. When a process switches from the running state to the ready state (for example, when an interrupt occurs)
  3. When a process switches from the waiting state to the ready state (for example, at completion of I/O)
  4. When a process terminates

For situations 1 and 4, there is no choice in terms of scheduling. A new process (if one exists in the ready queue) must be selected for execution. There is a choice, however, for situations 2 and 3. When scheduling takes place only under circumstances 1 and 4, we say that the scheduling scheme is nonpreemptive or cooperative. 

My doubt for situation 3 is, Process will inevitably move to ready state once I/O operation is complete as last burst is always CPU burst, so how do we have choice for CPU-scheduling decisions to not take place for situation 3?

1 Answer

0 votes
0 votes

It is not necessary that same process will go to ready state after I/O operation.

Process with higher priority could switch the lower priority process.

Related questions

3.2k
views
1 answers
0 votes
Chetan Warke asked Nov 17, 2018
3,209 views
The first known correct software solution to the critical-section problemfor two processes was developed by Dekker. The two processes, P0 andP1, share the following variables: ... j;flag[i] = false;/* remainder section */} while (true);
176
views
1 answers
0 votes
miguelcruz100 asked Dec 13, 2023
176 views
does anyone know how to answer this , my professor said that the answer is the followinga.) Not safe. Processes P2 , P1 , and P3 are able to ... completely different answercan someone please explain to me what im doing wrong for both parts
274
views
1 answers
0 votes
phaniphani asked Nov 16, 2023
274 views
is it allowed in a B+ tree, while deletion to leave behind a key in internal nodes while deleting it from the leaf ?
110
views
0 answers
0 votes
Maxine asked Apr 3
110 views
Write a monitor to solve the consumer-producer problem. Thebasic program structure is shown as follows.monitor ProducerConsumer {int in, out, count;Item ... {ProducerConsumer.get(next_consumed);/* consume the item in next_consumed */}