Question: pseudo code required(paperwork need) Problem 1 Consider the intersection shown in the figure below. A B B Cars arrive at the intersection along the roads

pseudo code required(paperwork need)

pseudo code required(paperwork need) Problem 1 Consider the intersection shown in the

Problem 1 Consider the intersection shown in the figure below. A B B Cars arrive at the intersection along the roads marked A, B, and C, and proceed to take a left or a right turn. Thus Car A taking a right turn goes to road B and taking a left turn goes to road C, etc. The intersection has no traffic light or any other traffic control signs. Each car knows the road it is on and the turn it wants to take. Cars along each road come in one at a time and execute a procedure LEFT or RIGHT to go left or right respectively, passing the identity of the road it is coming from as an argument. ( Thus car coming on road B and wanting to take a left will execute LEFT(B)). A. Design the procedures LEFT and RIGHT using semaphores. The correct solution should support maximal parallelism, assure that no deadlocks occur, and there is no starvation. Of course there should be no collisions of the cars. B. How many semaphore variables does your solution require and why? C. What is the maximum number of cars that can be in the intersection in your solution

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!