Examples from Chapter 16 (Multithreading) of Programming C# 12.0 (O'Reilly).
- Example 1. Object visibility and methods
- Example 2. Non-thread-safe use of a thread-safe collection
- Example 3. Using ThreadLocal<T>>
- Example 4. Creating threads
- Example 5. Running code on the thread pool with a Task
- Example 6. Using the thread pool and then SynchronizationContext
- Example 7. Using ExecutionContext
- Example 8. Protecting state with lock
- Example 9. How lock blocks expand
- Example 10. Wait and Pulse
- Example 11. Using LazyInitializer
- Example 12. Task-based web download
- Example 13. Getting a task’s results with await
- Example 14. A continuation
- Example 15. Cancellation and chained continuations
- Example 16. Scheduling a continuation on the UI thread
- Example 17. Using TaskCompletionSource<T>
- Example 18. An APM pair and the corresponding synchronous method
- Example 19. Parallel convolution