title: Mechanics of Condition.Signal()
body: <p>If I had threads as below</p>
  
  <pre><code>void thread(){
  
  while() {
  
  lock.acquire();
  
  if(condition not true)
  
  {
  
  Cond.wait()
  
  }
  
  // blah blah
  
  Cond.Signal();
  
  lock.release();
  }
  }
  </code></pre>
  
  <p>Well I guess my main question is that whether the signalling thread continues running for a while after cond.signal() or immediately gives up the CPU?. I would like it in some cases not to release the lock before the woken up thread finishes execution and in some other cases it may be beneficial to release the lock immediately after signalling, without waiting for the other woken thread to finish.</p>
  
  <p>I understand that if there are any threads waiting on the condition then they get woken up on Cond.signal(). But what do you mean by woekn up - put on the ready queue or does the scheduler make sure that it runs immediately?. 
  and  what about the signalling thread.. does it go to sleep on the same condtion upon signalling? .. so then some other thread has to wake it up to make it release the lock?.</p>