3,732 views

1 Answer

Best answer
2 2 votes

The four necessary conditions for Deadlock are

                  1) Mutual Exclusion

                  2) No Preemption

                  3) Hold & Wait

                 4) Circular Wait ( Cycles)

Deadlock handling methods:

      Deadlock preventions, Deadlock avoidance, and Deadlock detection

                 1) Deadlock preventions: Disable at least one of the above condition which causes dead lock. This resulting in Deadlock free process.

                 2) Deadlock avoidance: In simple words, this is Banker's algorithm. Visit https://www.geeksforgeeks.org/operating-system-bankers-algorithm/

                 3) Deadlock detection: Deadlocks are detected and then recovered to get a deadlock free process. Detection is mainly divided in 2 ways.

                 1) Single instance ( A resource can be used by only one process )

                               In this case if a cycle is detected in resource allocation graph, then its Deadlock.

                                     

             2) Multiple Instance: ( When a single resource can be used by many process simultaneously)

                               In this case, Safety algorithm is used. 

 

 

 

• selected by
Position:
Show:

Related questions

1 1 vote
1 answers 1 answer
2.2k
2.2k views
iarnav asked Aug 9, 2018
2,238 views
As Galvin States we have for necessary conditions to have a deadlock as -1) M.E2) Hold and wait 3) No preemption4) Circular wait. Now, for a deadlock to happen does all f...
3 3 votes
1 1 answer
163
163 views
GO Classes asked Aug 26
163 views
Consider the resource allocation graph below consisting of four tasks $(\text{T1}$, $\text{T2}$, $\text{T3}$, and $\text{T4})$ and three resources $(\text{R1}$, $\text{R2...
3 3 votes
1 1 answer
126
126 views
GO Classes asked Aug 21
126 views
In a multiprocessor system with preemptive scheduling, three processes $P_1,P_2,P_3$ share resources $R_1,R_2,R_3$.$P_1$ and $P_2$ compete for $R_1$. $P_2$ and $P_3$ comp...
2 2 votes
1 1 answer
156
156 views
GO Classes asked Aug 21
156 views
Four processes have the following state:$$\begin{array}{c@{\qquad\qquad}c}\textit{Current Allocation} & \textit{Current Request} \\ \begin{array}{|c|cc|}\hline\text{Proce...