Thread safe mersenne twister
问题 Looking for a thread safe random generator I found a mersenne twister generator class that the author says if thread safe: http://www.umiacs.umd.edu/~yangcj/mtrnd.html But after studying the code I cannot see were it is safe thread. There are no locks of any kind or anything resembling a lock variable in there. Is this implementation really thread safe? If so what is the magic? 回答1: It appears to be thread-safe in the sense that two different MersenneTwist objects can be used concurrently.