5
Multitasking and Concurrency
This chapter is about allowing multiple actions to occur at the same time to improve performance, scalability, and user productivity for the applications that you build.
In this chapter, we will cover the following topics:
- Understanding processes, threads, and tasks
- Running tasks asynchronously
- Synchronizing access to shared resources
- Understanding
async
andawait
Understanding processes, threads, and tasks
A process, with one example being each of the console applications we have created, has resources like memory and threads allocated to it.
A thread executes your code statement by statement. By default, each process only has one thread, and this can cause problems when we need to do more than one task at the ...
Get Apps and Services with .NET 8 - Second Edition 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.