[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-gsl] Re: Random number generators and Pthreads

From: Rodney Sparapani
Subject: [Help-gsl] Re: Random number generators and Pthreads
Date: Thu, 16 Nov 2006 09:26:55 -0600
User-agent: Thunderbird (X11/20060915)

Martin Jansche wrote:

View the problem like this: you need a pool of k random words for your
k threads. For debugging purposes, it makes sense if you can
initialize that pool to a fixed set of values. For actual simulation
runs (don't do this for cryptography), you could initialize the pool
in one of the ways described earlier, or you could read 4*k (or 8*k)
random bytes from /dev/random or /dev/urandom if you have it.  As you
point out yourself, reading the system time k times in quick
succession is not such a good idea.

Depending on your OS (Linux, FreeBSD, Solaris, ...) and hardware, you
may have hardware and/or software support for entropy pools. For
example, I have access to a machine that has /dev/hwrng and has rngd
running to read it and replenish /dev/random.

-- mj

Here's my 2 cents.  Independent parallel streams is a tricky problem.
I'm not an expert in this area so rather than my advice,
take a look at JE Gentle's Random Number Generation and Monte Carlo
Methods, 2nd Ed. He mentions several possible solutions and a free software project, SPRNG, that deals with this
directly.  However, I haven't gotten around to seeing how it might
mesh with GSL.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]