[.Net] What is concurrent collections thread-safe

System.Collections.Concurrent

For this purpose, the .NET Framework provides a System.Collections.Concurrent new namespaces can be used to access the address security thread, through this namespace can access the following set of well prepared for concurrency.
1.BlockingCollection classical blocking queue data structure is similar, can be applied to multiple tasks to add and delete data, provide blocking and bounding capabilities.
2.ConcurrentBag provide object thread-safe unordered collection
3.ConcurrentDictionary provide multiple threads simultaneously access a key thread safe collection
4.ConcurrentQueue provide thread-safe FIFO collection
5.ConcurrentStack provide thread-safe backward first-out collection of
these collections by using the compare and swap and memory barrier technology, avoid the use of typical mutually exclusive heavyweight lock to ensure thread safety and performance.

[Reading notes] .Net Parallel Programming (c) --- parallel set of
https://www.cnblogs.com/stoneniqiu/p/4931513.html
https://www.cnblogs.com/stoneniqiu/category/749413.html

C # .net collections - concurrent processing
https://blog.csdn.net/q3585914/article/details/79231268

C # concurrent queue the ConcurrentQueue
https://blog.csdn.net/conquerwave/article/details/50830648

Microsoft documentation
https://docs.microsoft.com/zh-cn/dotnet/standard/collections/thread-safe/
https://docs.microsoft.com/zh-cn/dotnet/api/system.collections.concurrent? view = netframework-4.8

Guess you like

Origin www.cnblogs.com/jinzesudawei/p/11588658.html