RandomSources.Shared Property

Gets a thread-safe, high-performance random source intended for convenience and incidental use.

Definition

Namespace: Numerics.NET
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.3.0
C#
public static ThreadSafeRandomSource Shared { get; }

Property Value

ThreadSafeRandomSource

Remarks

This source is safe to use concurrently. The implementation uses thread-local storage (TLS), similar to System.Random.Shared.

For reproducible results, create and pass a seeded RNG using Create(Int64).

See Also