processes, P,Q,R,S, and resources A,B,C
let process request resource : P() and Process release resource : V()
P |
Q |
R |
S |
P1(A) |
P2(C) |
P3(B) |
P4(A) |
P1(B) |
P2(A) |
P3(C) |
P4(C) |
V1(A) |
V2(C) |
V3(B) |
V4(A) |
V1(B) |
V2(A) |
V3(C) |
V4(C) |
Can the system of four processes get into a deadlock ?
Yes : P1(A) -> P2(C) -> P3(B) -> P4(A) busy wait -> P1(B) busy wait -> P2(A) busy wait-> P3(C) busy wait
Will the processes always get into a deadlock ?
No : any sequential execution of processes not going to Deadlock. Ex- PQRS.
strategies can be used to prevent deadlocks in a system :
1. there are 4 processes and each process is requesting to resources so we can allow maximum to processes at a time until any process releases there resource.\
suggest some more strategies to prevent deadlocks in a system.