Chapter 16: Asynchronous Programming

In this chapter, you will learn about the Task-based Asynchronous Pattern (TAP). You will learn how to program tasks asynchronously and how to access web resources using async, await, and WhenAll. You will also learn about different return types and extract the required results. Plus, you will learn how to correctly cancel asynchronous operations and perform asynchronous file reading and writing.

In this chapter, we will be covering the following topics:

  • Understanding the TAP model: In this section, we provide a high-level overview of the TAP model.
  • Using async, await, and Task: In this section, we will benchmark the performance of a method run synchronously (using Task.Run) and asynchronously.
  • Benchmarking ...

Get High-Performance Programming in C# and .NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.