Chapter 6. Thread Usage

When your site accesses a file or an off-box resource such as the database or a web service, the thread executing the request is blocked while it waits for the resource to respond. You now have a thread doing nothing, while there may be requests waiting for a thread to become available.

You can solve this by using asynchronous methods to access files and off-box resources. Instead of blocking a thread, these methods release the thread when they start waiting, so that it can then be used by another request. When the resource becomes available, a new thread is acquired from the thread pool to continue processing.

This chapter shows how to convert synchronous code that blocks the thread to asynchronous code. Each example will ...

Get ASP.NET Site Performance Secrets now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.