Handling Deadlock

I was going through Arnav bhaiya’s Deadlock Handling method video where he said that as all the memory and processing power is already consumed by other processes in deadlock. We need to have seperate chip which has the deadlock algo. And which executes it.
Now, my doubt is that it isn’t necessary that all the memory and processing power is consumed when few of the resources are in deadlock. Right? In fact, I feel its highly unlikely that all ram and cpu will be consumed in such a situation just because of few processes being stuck in deadlock. Also, being in deadlock doesn’t mean that the whole system stops right? Only few application in the system will stop whose processes are in the deadlock. Wanna confirm this one.

Also, in Deadlock prevention bhaiya said in a deadlock prevented system if we don’t have hold and wait then our the processing power is wasted. But isn’t it anyways wasted upon holding also. The processes cannot use the resources until they get hold of all the resources right? Otherwise, the resources would have been freed even without getting the hold of other resources and we wouldn’t be having any deadlock.

We do not need a ‘separate chip’. But we need separate dedicated processing power and memory reserved within the same hardware that will kick off when deadlock mitigation is needed.

When a deadlock happens, all functions of OS get stalled, as the process scheduler has no idea what to do next.

For your second question,

if we don’t have hold and wait then our the processing power is wasted. But isn’t it anyways wasted upon holding also.

Resources are wasted much more if there is no hold and wait. Because processes can still do non critical work before entering critical section. But if we remove hold and wait, then process does not proceed unless all required resources are available.

1 Like