title: Using stdlib's rand() from multiple threads
body: <p>I have several threads which all run the same function. In each of these they generate a different random number several times. We tried to do this by putting <code>srand(time(0))</code> at the start of the function, but it seems that they all get the same number.</p>
  
  <p>Do we need to call <code>srand(time(0))</code> only once per program, i.e at the start of <code>main</code> (for example), at the start of each function that is called several times, or something else?</p>