in Operating System
1,671 views
1 vote
1 vote
Which are invalid process state transition?

a.  Timer Start: ready->running

b.  Timer Out: running->blocked

c.  I/O: running->ready

d.  Resume : suspend->running
in Operating System
1.7k views

3 Answers

8 votes
8 votes
Best answer
Let us discussion about option A) and B) first since both of them are related to timer.First of all , we should know that timer is a device which lets us know if a process needs to be preempted or not.

Timer expire is also a kind of interrupt which occurs in time sharing system and in other words we can say Round Robin Algo is involved.Whenever a process is scheduled and dispatched from ready state to running state , the timer is initialised to value equal to time quantum.Hence A) option is valid.

Now if a process needs to execute for a time slice less than the time quantum decided earlier , then process is completed and sent to termination state.But if it is larger then , it executes for a time quantum as a result of which timer value becomes 0 after completion of time quantum.Hence after this , "timer expires" interrupt occurs and as a result the process is placed at the tail of the ready queue once again and hence in ready state.Here we have to keep in mind that timer is used specifically in case of Round Robin Algorithm since there is requirement of equal time quantum after every preemption.

So the conclusion is that "timer expires" is a special type of interrupt that involves transition from running state to ready state and not to I/O wait state since we go to I/O state to service interrupts which are caused due to I/O devices.Hence , B) option is invalid.

As stated earlier , I/O  results in transition from running state to I/O wait state not ready state.Hence C) option is also invalid.

Resuming of process is done by mid term scheduler either from suspend I/O wait to I/O wait state in case the I/O resources become sufficient or from suspend ready to ready state.Hence D) option is invalid as well.

 

Hence B),C) and D) options are invalid.
selected by

1 comment

Nice explaination Habib :)
1
1
0 votes
0 votes
Answer is C

I/O: running->ready is wrong.
It should be  I/O: running->blocked
by

1 comment

if it is Preemptive scheduling then ?

And how D is true ?
1
1
0 votes
0 votes

Ans is - D. As there is no transition from Suspended state to running directly. It first has to go to ready state.

Related questions