Chapter 4: Threading and Asynchronous Operations
So far, we have looked at various design principles, patterns, what is new in .NET 6, and architecture guidelines that we are going to use during this book. In this chapter, we will see how we can take advantage of asynchronous programming while building enterprise applications.
One of the key measures for any web application is scalability – that is, scaling to reduce the time taken to serve a request, increase the number of requests that a server can process, and increase the number of users an application can simultaneously serve without increasing the load time. For mobile/desktop apps, scaling can improve the responsiveness of the app, allowing users to perform various actions without freezing the screen.
The proper use of asynchronous programming techniques and parallel constructs can do wonders in improving these metrics, and the best thing for this in C# is the simplified syntax of the Task Parallel Library (TPL...