title: Semaphores in C++ /linux
body: <p>How can I increment the semaphore based on a function output count in a thread safe manner with multiple consumers? </p>
  
  <p>Basically how do I increment the sem_post(&amp;semValue)  by an amount that can change during run time and how do I decrements the semwait(&amp;semValue) by a runtime amount? </p>