title: Incrementing variable multi-threading
body: <p>Suppose I have 10 threads that are incrementing a variable by 1. Suppose Thread-1 increments a variable first, and then Thread-2 and Thread-3 and consecutively. after all the 10 Threads have incremented the variable. I need to decrement the same variable in a manner.</p>
  
  <p>Decrementing, if Thread-1 incremented the variable first of all, then it should decrement at last.</p>
  
  <p>We need to do this without setting thread priority.</p>