Wednesday 3 June 2020

UGC NET Computer Science December 2019 | Question 124

Question 124
Identify the circumstances under which preemptive CPU scheduling is used :
(a) A process switches from Running state to Ready state
(b) A process switches from Waiting state to Ready state
(c) A process completes its execution
(d) A process switches from Ready to Waiting state
Choose the correct option :
  1. 1. (a) and (b) only
  2. 2. (a) and (d) only
  3. 3. (c) and (d) only
  4. 4. (a), (b), (c) only
Answer : 1. (a) and (b) only

Explanation Question 124

Preemptive Scheduling According to Standard book of Galvin,
CPU scheduling decisions take place under one of four conditions:
  1. When a process switches from the running state to the waiting state, such as for an I/O request or invocation of the wait( ) system call.
  2. When a process switches from the running state to the ready state, for example in response to an interrupt.
  3. When a process switches from the waiting state to the ready state, say at completion of I/O or a return from wait( ).
  4. When a process terminates.
  • For conditions 1 and 4 there is no choice - A new process must be selected.
  • For conditions 2 and 3 there is a choice - To either continue running the current process, or select a different one.
  • If scheduling takes place only under conditions 1 and 4, the system is said to be non-preemptive, or cooperative. Under these conditions, once a process starts running it keeps running, until it either voluntarily blocks or until it finishes. Otherwise the system is said to be preemptive.
In above discussion. it's given that If scheduling takes place only under conditions 1 and 4, the system is said to be non-preemptive. Otherwise the system is said to be preemptive. Therefore point 2 & 3 are condition for preemptive system.

Here point 2 and 3 are as listed below
  • When a process switches from the running state to the ready state.
  • When a process switches from the waiting state to the ready state.
These above point matches with circumstances (a) & (b) given in question.

So, option 1 is correct answer

Reference 1 : CPU Scheduling - Preemptive Scheduling


PreviousNext
UGC NET CS December 2019 - Question 123UGC NET CS December 2019 - Question 125

No comments:

Post a Comment

UGC NET Computer Science December 2019 | Question 16

Question 16 In a certain coding language. 'AEIOU' is written as 'TNHDZ'. Using the same coding language. 'BFJPV' wil...

Popular Posts