Dear Juan Antonio,
On Sun, 14 Nov 2010 16:03:12 +0100
Juan Antonio Farré Basurte
Are random number generators thread safe? Can I use a random number generator by multiple threads without explicit locking?
I guess the answer is no... Then I wonder if every thread could use a different instance of the same random number generator without interference between the different generators.
you might consider to use the TRNG library [1] for multithreaded Monte Carlo. It is very similar to Boost random but has some special support for parallel random number generation. Read the TRNG documentation [2] for details. Regards, Heiko [1] http://trng.berlios.de/ [2] http://trng.berlios.de/trng.pdf -- -- Wer lügt, hat die Wahrheit immerhin gedacht. -- (Oliver Hassencamp, dt. Schriftsteller, 1921-1987) -- Number Crunch Blog @ http://numbercrunch.de -- Heiko Bauke @ http://www.mpi-hd.mpg.de/personalhomes/bauke