你的位置: 码友网首页 / 资讯源列表 / Working with System.Random and threads safely in .NET Core and .NET Framework

关于[Working with System.Random and threads safely in .NET Core and .NET Framework]的摘要:

In this post I look at some of the ways you can misuse System.Random for generating random numbers, specifically around thread safety. I start by showing how to use the built-in thread-safe Random generator in .NET 6. I then step back to previous .NET Core implementations, before the thread-safe Random generator was added, and show how to add your own. Finally, we take one more step back to .NET Framework, and look at he issues that arise there.

原文地址: https://andrewlock.net/building-a-thread-safe-random-implementation-for-dotnet-framework/

收录时间: 2022-09-07 浏览量: 1085 分类: .NET

| 1 收藏 | 0