title: Java Unisex bathroom using semaphores & monitors
body: <p>I've been set an assignment for concurrent programming, to code a Unisex Toilet. It seems to be a common enough assignment for this subject. For those unfamiliar, the rule are set (in this case at least)</p>
  
  <ul>
  <li>The bathroom can be used by both men and women but not both at the same time. </li>
  <li>The most people you can have in the toilet at once are 5.</li>
  <li>If you use a semaphore, you must implement it yourself. </li>
  </ul>
  
  <p>I haven’t coded in a long time before this subject, and my knowledge is rusty. I initially coded this up with just counters, and had problems understanding the flow of information though the programme and that version got nowhere! </p>
  
  <p>So I’m starting again, and am looking to know what general way I should go about this. My initial idea is to have 1 toilet, implemented with a binary semaphore, with monitor for the bathroom, limited to 5. </p>
  
  <p>I've also read that the idea behind the problem lends its self best to an implmentation where each person is a thread. If this is the case, it could be messy, as I've tried thread pooling once (few week back) and it never ran for me. :-/</p>
  
  <p>For the moment I’ve no code to show, so an outline as to how things are set up is my biggest concern.</p>