Another namespace that was introduced in .NET 4.0 is
Systems.Collections.Concurrent. This is not directly a part of TPL, but it is often used in conjunction with TPL to provide much of the common parallel design patterns such as producer-consumer that we will discuss in Chapter 9, Pipeline and Producer-consumer Design Patterns.
System.Collections.Concurrent provides a thread-safe version of collection classes in the
Systems.Collections namespace. These work very well in conjunction with tasks. This namespace has
ConcurrentBag, which is a collection of objects such as
BlockingCollection to name the most popular ones.
All of these concurrent collections implement ...