Question: Write code for the following scenario, use a named semaphore and two processes. At a Y junction in the subway, a signal alternates first to

Write code for the following scenario, use a named semaphore and two processes. At a Y junction in the subway, a signal alternates first to allow a train from the left line onto the main track, then a train from the right track onto the main track, then back to left, etc. In the left train code (.c file) simulate 5 trains coming from the left track with a for loop, for example for(trains = 0; trains
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
