O'Reilly logo

ASP.NET Site Performance Secrets by Matt Perdeck

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required