Summary
In this chapter, we focused on converting synchronous code, which blocks the current thread, to asynchronous code, that releases the thread while waiting for an off-box operation to complete. This makes more threads available to IIS to process requests.
We first saw how to convert synchronous access of a web service to asynchronous access. Then we looked at the more complex case of asynchronously accessing a database, including an asynchronous data layer, and then applied this to both, a regular web page and a generic handler. We then learned how to write a file asynchronously.
This chapter also discussed configuring the server in relation to the threads it uses to process requests, and wrapped up by looking at changing page timeouts to free resources as soon as possible.
In the next chapter, we'll find out how to measure wait times for external resources such as web services and locks. We'll also see how to reduce those wait times.