Unsafe State in Resource-Allocation Graph
· The RAG above is compose of 2 resources and 2 processes
· P1 holds an instance of R1
· P2 is requesting an instance of R1
· P2 holds an instance of R2
· P1 may request an instance of R2
· P1 holds an instance of R1
· P2 is requesting an instance of R1
· P2 holds an instance of R2
· P1 may request an instance of R2
Resource-Allocation Graph For Deadlock Avoidance
· P1 holds an instance of R1
· P2 requests an instance of R1
· P1 and P2 may request an instance of R2
Resource-Allocation Graph With A Cycle But No Deadlock
- P1 is holding an instance of R2 and requests instance of R1.
- P2 is holding an instance of of R1.
- P3 is holding an instance of R1 and requests instance of R2.
- P4 is holding instance of R2.
Resource-Allocation Graph With A Deadlock
- P1 is holding an instance of R2 and requests instance of R2 and requests instance of R1
- P2 is holding an instance of R1 and R2 then requests of instance of R3
- P3 is holding an instance of R3 and requests an instance of R2
- R1 or resource 1 is composed of only one instance
- R2 has 2 instances
- R3 has one instance
- R4 has 3 instances
Example of Resource-Allocation Graph
- P1 is holding an instance of R2 and requests instance of R1.
- P2 is holdng an instsnce of R1 and R2 ang requests of instance of R3.
- P3 is holding an instance of R3.
No comments:
Post a Comment