In a barber shop there are 2 doors. customer come in 1
door, leave in other. minimum # of chairs. barber spend his
life in cutting. always barber can cut 1 customer. few
chairs in the shop. if barber busy customer waits, if
chairs full, customer leave. if no customer, barber sleeps.
treat barber and customer as 2 threads. you can use
Semaphore class with arrive and depart and count as
parameter.
No Answer is Posted For this Question
Be the First to Post Answer
How do I run a java project in netbeans?
Explain working of java virtual machine (jvm)?
What is jsr in java?
Can a dead thread be started again?
Can we extract main method from another class?
What is the difference between a jdk and a jvm?
What are java’s rules regarding tabs, spaces and newline characters?
Explain the encapsulation principle.
Do I need both jdk and jre?
What is the difference between jar and executable jar?
Which interceptor is responsible for setting action javabean properties?
Is jpa a framework?