Exercise3-48 <---> Exercise3-50
Exercise 3.49
Exercise 3.49. Give a scenario where the deadlock-avoidance mechanism described above does not work. (Hint: In the exchange problem, each process knows in advance which accounts it will need to get access to. Consider a situation where a process must get access to some shared resources before it can know which additional shared resources it will require.)
Let us consider a situation where an account can be linked to another account. Peter is trying to link account a1 to account a2 in process P1. Paul is trying to link account a2 to a1 in process P2.
P1 gets access to account a1. P2 gets access to account a2. Now P1 tries to access a2, which P2 tries to access a1. However both are locked by the other process leading to a dealock. A numbering system given in the previous problem will not avoid the deadlock.
Exercise3-48 <---> Exercise3-50