I'm not sure how relevant this is (I'm not familiar with Monte Carlo
algorithms), but I needed a fast and thread-safe PRNG for some other
project and ended up with this:
http://github.com/karmazilla/nanopool/tree/master/src/main/java/net/nanopool/CheapRandom.java

It's only a medium-quality PRNG and it is only thread-safe if
safely-published, but it operates without any synchronization and
therefor does not slow down any bit under concurrent use.

On Tue, Oct 28, 2008 at 6:37 PM, Mark H. <[EMAIL PROTECTED]> wrote:
>
> On Oct 28, 8:48 am, Stuart Halloway <[EMAIL PROTECTED]> wrote:
>> Java does thread protect, but it is synchronized. Also java.math and
>> java.util's random number generator aren't pluggable with alternate
>> implementations. For that I would need SecureRandom.
>>
>> For my simple example I think I will use a per-thread
>> java.util.Random, note the issues, and point interested readers to the
>> literature.
>
> Does using a per-thread java.util.Random object guarantee that the
> threads' random streams are not correlated?  If you pick the seeds
> unluckily then the threads' random streams might overlap, making the
> Monte Carlo method's results suspect.
>
> mfh
> >
>



-- 
Venlig hilsen / Kind regards,
Christian Vest Hansen.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to