Concurrent And Distributed Systems.
Part 1. For this part, you may use wait-chain diagrams as introduced in Chapter 7 to justify your answer. If you like, you can use some other notation that allows you to detect deadlock but you must still justify your answer.
i)There are 3 resources, G, H and J, each of which can be acquired and released (that is, locked and unlocked). There is one resource-usertype or class, Q. Each instance of Qrepeatedly executes this sequence:
It acquires resource G, and then resource H.
It then releases G and acquires resource J.
It then releases H and acquires G.
It then releases G and J.
How many instances of Qdoes it take to create deadlock?
ii)There are 5 resources, A, B, F, G, I, each of which can be acquired and released. There are two resource-user (or thread) types Sand T.
Each instance of Srepeatedly executes this sequence:
It acquires I, then A, and then G.
It releases A and G.
It acquires B.
It releases I and then B.
Each instance of Trepeatedly executes this sequence:
It acquires G and then F
It releases G
It acquires A
It releases F and then A
- How many instances of Sdoes it take to create deadlock if there are no instances of T?
- How many instances of Tdoes it take to create deadlock if there are no instance of S?
- There are instances of Sand of T. How many instances of Sand how many instances of Tdoes it take to create deadlock?
Part 2:What is each node’s vectorclock value at the end? P1’s clock starts at (1, 0, 0). P2’s clock starts at (0, 1, 0). P3’s clock starts at (0, 0, 1).
-
CS844_U4IP_Im