Quantcast
Channel: Math.NET Numerics
Viewing all articles
Browse latest Browse all 971

New Post: Thread Safe Random Variate Generation

$
0
0
Hi,

Yes, the RNGs will be thread-safe then (with v3 alpha there's also a SystemRandomSource that wraps System.Random in a thread-safe way but is faster than our MersenneTwister). However, if you can control the threads and on what thread the code is executing, you'd be much faster with a separate RNG instance per thread where each RNG is only used from within a single thread and thread-safety/locking can thus be disabled completely.

Unfortunately the equivalent of the significantly faster array-based routines (that fill a whole array with random numbers in one go) of the RNGs in recent v3 alphas is not yet available in the probability distributions, but this is currently being worked on.

Thanks,
Christoph

Viewing all articles
Browse latest Browse all 971

Trending Articles