title: Multithreading, when to yield versus sleep
body: <p>To clarify terminology, yield is when thread gives up its time slice.
  My platform of interest is POSIX threads, but I think the question is general.</p>
  
  <p>Suppose I have consumer/producer pattern. If I want to throttle either consumer or producer, which is better to use, sleep or yield? I am mostly interested in efficiency of using either function.</p>