Question: Implement a Java concurrent program using semaphores to access a car park with two gates, the park has a maximum capacity of 5 0 0
Implement a Java concurrent program using semaphores to access a car park with two gates, the park has a maximum capacity of cars. The car runnable is given below:
class Car extends Thread Tunnel tunnel;
public CarTunnel t
tunnel t;
public void run tunnel.enter;
trystay in tunnel for random period int t intMathrandom; Thread.sleept;
catchInterruptedException e tunnel.leave;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
