Question: a) Program 6.4 has a binary semaphore s, local to each node. Why is it necessary? b) Suppose that the binary semaphore s is deleted

 a) Program 6.4 has a binary semaphore s, local to each

node. Why is it necessary? b) Suppose that the binary semaphore s

is deleted from the method replyToDefferedNodes and the V(s) in thread handleRequests

a) Program 6.4 has a binary semaphore s, local to each node. Why is it necessary? b) Suppose that the binary semaphore s is deleted from the method replyToDefferedNodes and the V(s) in thread handleRequests is moved up just before the if statement. Show that a deadlock is possible. c) Does the V(s) in replyToDefferedNodes need to be moved to the end of the method? In other words, why have a P(s)...V(s) bracket the single assignment statement requesting false? Where is the race condition? d) Suppose node m decides to enter its critical section and sends a request message to node n. Node n sends a reply message to node m indicating that node n does not want to enter its critical section. Suppose further that nodes n later decides to enter its critical section and sends a request message to node m. What happens if node n's request message is received by node m before the earlier-sent reply message of node n to node m? a) Program 6.4 has a binary semaphore s, local to each node. Why is it necessary? b) Suppose that the binary semaphore s is deleted from the method replyToDefferedNodes and the V(s) in thread handleRequests is moved up just before the if statement. Show that a deadlock is possible. c) Does the V(s) in replyToDefferedNodes need to be moved to the end of the method? In other words, why have a P(s)...V(s) bracket the single assignment statement requesting false? Where is the race condition? d) Suppose node m decides to enter its critical section and sends a request message to node n. Node n sends a reply message to node m indicating that node n does not want to enter its critical section. Suppose further that nodes n later decides to enter its critical section and sends a request message to node m. What happens if node n's request message is received by node m before the earlier-sent reply message of node n to node m

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!