dotnet / dotnet/dotnet-api-docs
System.Random class and thread safety - mention Random.Shared
Open
area-System.Runtime
Pri3
untriaged
- Dominant language
- C#
- Stars
- 949
- Forks
- 1.7k
- Avg merge
- 3d 27m
- Merged PRs (30d)
- 49
Description
* Docs link: https://learn.microsoft.com/en-us/dotnet/api/system.random?view=net-7.0#the-systemrandom-class-and-thread-safety
* Starting from .NET 6 there is a built-in solution: https://learn.microsoft.com/en-us/dotnet/api/system.random.shared
* IMHO you could delete everything in the section starting from `The following example uses...` and replace with something like `If you require concurrent usage of the Random class from multiple threads, consider using Random.Shared`.
Contributor guide
Assessment
This issue has not been assessed yet.