Necessary condition for the deadlock system(OS -2)

Necessary condition for Deadlock

A deadlock system contains process and resources satisfy by the following the 4 condition.

Mutual exclusion:

-It means resources are (at least one) in non shareable mode only.
-It means only one process at a time can use the resources .
-If some other process request the resources than the process will must wait until the resources has been released.
-e.g A printer is a non shareable device bcz the printer can,t be share by the multiple no of process at a time.

Hold and wait:

-each and every process in deadlock state and must held at least one resources and waiting for other resources which again held by other process.
-p1,p2,p3 are 3 process and r1 , r2 , r3 are`3 resources each process can must hold resources.
  
  in this diagram p1 is holding the resources r3 and waiting for the resources r1 and p2 is holding the resources r1 & r4 and waiting for the resources r2 & r3.
       p3 is holding the resources r2 and waiting for the resources r4.

No preemption:

It means resources are not released in the middle of the work. they release only of the process has completely its task.

circular wait:

In RAM if the process and resources for a circular path then deadlock will arise otherwise no dead lock.
p1→r1→ p2→r2=p3 →r4→p2→r3                                                                                                                                                                                                                                                                                                          










  

Comments

Popular posts from this blog

What is queries in SQL[DBMS-6]

What is demand paging(OS-9)

Draw process state diagram and explain each state(OS-3)