Mudit Kumar Saini
Mudit Kumar Saini

Reputation: 83

Starvation and Deadlock (Operating System)

I know deadlock and starvation definitions, but I'm still confused in these few points (Unable to arrive at which one is correct)

Upvotes: 8

Views: 11811

Answers (3)

displayName
displayName

Reputation: 14369

Deadlock: is when all the processes do not get access to resources because every process is waiting for some another process and there is a cycle.

Starvation: is when a low priority process does not get access to the resources it needs because there is a high priority process accessing the resources. The entire system of processes hasn't come to halt in this case.


Since, only low priority process does not have access to resources in starvation, while in deadlock no process has access to the resources they need therefore deadlock is an extreme case of starvation with the criterion of extremeness being the total count of process unable to access the resource.


Deadlock and starvation are related as both are the cases of a process not having access to the resource.


Starvation does not lead to deadlock as a starving low priority process keeps waiting while other processes with high priority run to completion.

Rumor has it that when they shut down the IBM 7094 at MIT in 1973, they found a low-priority process that had been submitted in 1967 and had not yet been run.


Mentioned in the Operating System Concepts book by Abraham Silberschatz, Peter B. Galvin, Greg Gagne

Upvotes: 14

CHINNAMNAIDU SIRIKI
CHINNAMNAIDU SIRIKI

Reputation: 1

DeadLock : If two threads are waiting for each other and forever,such type of infinite waiting is called deadlock.Long waiting of a thread where waiting never ends is also called as deadlock. Starvation : Long waiting of a thread where waiting ends at a certain point is called as deadlock. For example low priority thread has to wait until completing all high priority threads,it may be long waiting but ends at certain point,is nothing but starvation.

Upvotes: 0

sehe
sehe

Reputation: 392833

Well, a is correct.

Starvation can lead to softlock or suboptimal performance (scheduling).

Since deadlock is a special case of starvation (all contenders are resource-starved) they are /not/ unrelated.

Upvotes: 0

Related Questions