A system of four concurrent processes, P,Q,R and S, use shared resources A,B and C. The sequences in which processes, P,Q,R and S request and release resources are as follows:
Process P: Process Q: Process R: Process S: 1.2.3.4.1.2.3.4.1.2.3.4.1.2.3.4. P requests A P requests B P releases A P releases B Q requests C Q requests A Q releases C P releases A R requests B R requests C R releases B R releases C S requests A S requests C S releases A S releases C
If a resource is free, it is granted to a requesting process immediately. There is no preemption of granted resources. A resource is taken back from a process only when the process explicitly releases it.
Can the system of four processes get into a deadlock? If yes, give a sequence (ordering) of operations (for requesting and releasing resources) of these processes which leads to a deadlock.
Will the processes always get into a deadlock? If your answer is no, give a sequence of these operations which leads to completion of all processes.
What strategies can be used to prevent deadlocks in a system of concurrent processes using shared resources if preemption of granted resources is not allowed?