When deadlock detection and recovery technique is used, the system doesn't attempt to prevent deadlocks from occurring.
But it lets them occur, tries to detect whenever this happens, and then takes some action to recover after the fact.
The deadlock recovery will be discussed in the next tutorial.
Here we will discuss about the following two cases for the deadlock detection.
Now let's describe briefly about the above two cases of deadlock detection.
In this case, there is only one resource of each type exists. Such type of a system might have one plotter, one scanner, one tape drive, and one DVD recorder, but no more than one of each class of resource.
In other words, we can say that, we are excluding computer systems with two printers for the moment.
In case if the graph of this system contains one or more cycles, then a deadlock exists. Any process that is part of a cycle is deadlocked. In case if no cycle exist, then the system is not deadlocked.
In this case of deadlock detection, whenever multiple copies of some of the resources exist, a different approach is needed to detect deadlocks.
In this case, present a matrix-based algorithm to detect deadlock between/among more than one processes or among n processes, that is P1 through Pn.