title: when to use Thread, interrupt and join
body: <p>i am doing a sleeping barber prob. So, first i create 10 customer threads with 2 sec "sleep" between each other. now, the first client gets hair cut, means sleeping 5 sec.. we have waiting room for following threads where we have place for only 3 threads. </p>
  
  <p>if a customer thread is getting hair cut, and 3 following threads are in queue, other customer threads created after that must stop unless there is an available position in 3 sit waiting room.</p>
  
  <p>when 1st customer gets cut, second customers cut starts,, so 2 threads are in queue, only in this case one more thread can join the waiting.</p>
  
  <p>to do all these task, can someone tell me in short, where to use sleep, interrupt and join. especially how to make threads wait for others to finish, and how to detect how many threads are currently waiting/sleeping?</p>