Chapter 6: Thread safety and immutable collections
In this chapter
- Concurrent collections
- When should you use concurrent collections?
ConcurrentDictionary<TKey, TValue>ConcurrentQueue<T>andConcurrentStack<T>ConcurrentBag<T>
- Immutable design and collections
- Building immutable custom types
- Using
System.Collections.Immutablecollections - Build once, read many times:
FrozenDictionary<TKey, TValue>andFrozenSet<T> - A pitfall to avoid: the default-value trap in
ImmutableArray<T>
- Quick reference for the collections in this chapter
- Concurrent, immutable, or frozen: how should you choose?
- Summary
This chapter is not available in the free preview. Purchase the book to read the complete edition now.