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

Post New Answer

More Java Related AllOther Interview Questions

Why do we need framework in java?

0 Answers  


Can I use openjdk for commercial?

0 Answers  


why the sleep method does not leave the lock and wait method leave the lock

4 Answers  


Which method is used to create the daemon thread?

0 Answers  


How do I run a java project in netbeans?

0 Answers  






Is jar an executable?

0 Answers  


What is cdi bean in java?

0 Answers  


What is flatmap in rxjs?

0 Answers  


What is dto layer in java?

0 Answers  


Is java a framework?

0 Answers  


Why are lambda functions called lambda?

0 Answers  


What is java aop?

0 Answers  


Categories