I\'m writing a program that will generate numerous random numbers in loops. I\'m trying to make the numbers somewhat less predictable (not only for security, but to avoid c
let's break this question into two separate ones.
if you worry about race conditions when accessing random number generator, create a mutex or other synchronization primitive to avoid this.
if you think about calling srand()
several times, please, don't. the reason behind this is the random generator initialization routine which sets up the variables based on seed has worse random characteristics, gives worse performance than the random generator itself and should be not used as a substitute.