We could call it a muscle memory, as we could notice that an asynchronous operation is already in place; we perform all operations in an asynchronous way. Even though it's been covered, let's reiterate how the asynchronous operations were handled in our blogging system and see the simplicity when we used async/await syntactic sugar implementations for asynchronous operations.
The asynchronous execution helps us in supporting multiple requests in parallel, without locking a thread against a long-running process. To understand how the threads should be managed properly, let's go through the following execution process:
- The request reaching the ASP.NET pipeline will be allocated to a thread, which takes care of the execution
- The thread will be occupied until the request is complete
- If the action consumes any long-running process in a synchronous...