5. Concurrency: Multithreading Parallel and Async Code
Overview
C# and .NET provide a highly effective way to run concurrent code, making it easy to perform complex and often time-consuming actions. In this chapter, you will explore the various patterns that are available, from creating tasks using the Task
factory methods to continuations to link tasks together, before moving on to the async
/await
keywords, which vastly simplify such code. By the end of this chapter, you will see how C# can be used to execute code that runs concurrently and often produces results far quicker than a single-threaded application.