title: What are the costs of a condition variable?
body: <p>Assume that unused execution resources are available on the machine in question, i.e. not all CPUs are being utilized.  If a thread is waiting on a condition variable, what are the costs associated with waking up this thread?  Similarly, what are the costs associated with waiting on a condition variable?  I'm interested in both a rough quantification and where the costs come from.  To the extent that the answer is "it depends", I primarily care about recent versions of Windows and Linux on x86/x64.</p>
  
  <p>Edit:  Since kernel calls are involved, how much more expensive is a kernel call than a regular function call?</p>