Question: Question 2 (12 marks) There is a bridge over a deep cavern. A group of people want to cross, but the bridge is unstable and


Question 2 (12 marks) There is a bridge over a deep cavern. A group of people want to cross, but the bridge is unstable and can only support at most two people at one time. The code for the Person class is given below, which represents a person crossing the bridge. It uses a shared semaphore bridge. Person code: wait(bridge); cross0 signal(bridge); Question 2 (12 marks) There is a bridge over a deep cavern. A group of people want to cross, but the bridge is unstable and can only support at most two people at one time. The code for the Person class is given below, which represents a person crossing the bridge. It uses a shared semaphore bridge. Person code: wait(bridge); cross0 signal(bridge)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
