|
Boost Users : |
Subject: Re: [Boost-users] Boost.Random multithreading
From: Heiko Bauke (heiko.bauke_at_[hidden])
Date: 2010-11-15 03:48:19
Dear Juan Antonio,
On Sun, 14 Nov 2010 16:03:12 +0100
Juan Antonio Farré Basurte <jafb_at_[hidden]> wrote:
> 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
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net