C# (CSharp) RandomOps.ThreadSafe Пространство имен

Классы

Имя Описание
CMWC4096 Thread-safe version of CMWC4096 which generates one PRNG object for each thread and seeds it using a MersenneTwister. The CMWC4096 is used because it has a very long period and hence decreases the risk of overlap and correlation of the individual threads.
Independent Base-class for making thread-safe PRNGs by creating one PRNG object for each thread. The PRNGs should have very long periods to avoid overlapping. See ThreadSafeMWC256 for an example. This is a simple and reliable way of making an efficient and parallel PRNG, see the paper: P.D. Coddington, Random Number Generators for Parallel Computers, NPAC Technical Report, Version 1.1, 1997.
MWC256 Thread-safe version of MWC256 which generates one PRNG object for each thread and seeds it using a MersenneTwister. The MWC256 is used because it has a very long period and hence decreases the risk of overlap and correlation of the individual threads.
Wrapper Wrapper for an RNG that makes the calls to Uniform(), Bool(), Byte(), and Bytes() thread-safe by locking the object. Note that it is the ThreadSafe object that is being locked and not the RNG object it wraps around, so calls to methods should always be made to the ThreadSafe-object and not to the RNG object directly. This works well for infrequent access to the RNG but for frequent access you should use e.g. ThreadSafe.MWC256 instead for performance reasons.