in Operating System
90 views
0 votes
0 votes
While of the following is incorrect?

(a) if a system uses preemptive CPU scheduler then deadlock is not possible in system

(b) Deadlock state is an unsafe state.

(c) If a system has total ordering of all resource types and each process requests resources only in a increasing order of enumeration, then system will never go in deadlock state.

(d) If a system is in deadlock state and all deadlocked processes aborted, then system will recover from deadlock.

 

 

according to made easy (a) is the right option……. but in preemptive scheduling we disabled one of the necessary condition of deadlock (i.e. no preemption disabled) therefore deadlock should not possible in preemptive scheduling then how can this statement could be incorrect. please clarify the doubt
in Operating System
90 views

1 comment

I think all are correct statements .
0
0

2 Answers

1 vote
1 vote
The keyword to notice here is preemptive CPU scheduler, this is talking about the scheduler responsible blocking and unblocking the processes, this scheduler doesn’t do anything to the resources held by the process.

Now we should not confuse this with preventing the no preemption characteristics of deadlock, where we preempt the process which is holding some resource needed and waiting for another resource. in this case we preempt( stop the process) and release the resources held by process and give these resource to the process requesting.

CPU scheduler doesn’t deal with resources, it only blocks( temporary stop) for a while and can be restarted(unless it is starving).

Another way to look at it is thinking about the deadlock in process synchronization problems when two processes P1 and P2 are using semaphore, often we preempt to check if solution for synchronization is working fine or not, sometimes deadlock occur and we say the solution is not working correctly.

Deadlock is dependent on process running and how they behave, in deadlock detection we notice that if a process requests for some resources then we can enter unsafe state which may result in deadlock.

The option a talks about scheduler which isnt related to deadlock and thus it is false statement

1 comment

Thank you sir for clarification
0
0
0 votes
0 votes
Deadlock is possible when we use preemptive priority scheduling algorithm. Because Priority inversion may happen in this case and eventually deadlock happen.

1 comment

is that deadlock ? I think that is defined as spin-lock which is not same as deadlock.
1
1

Related questions