ASP.NET 2.0 Performance Inspection Questions - Threading

From Guidance Share

Jump to: navigation, search

- J.D. Meier, Srinath Vasireddy, Ashish Babbar, Rico Mariani, and Alex Mackman


Threading Considerations

The .NET Framework exposes various threading and synchronization features, and the way your code uses multiple threads can have a significant impact on application performance and scalability. Use the following review questions to assess how efficiently your ASP.NET code uses threading:

Do you create threads on a per-request basis?

Avoid manually creating threads in ASP.NET applications. Creating threads is an expensive operation that requires initialization of both managed and unmanaged resources. If you do need additional threads to perform work, use the CLR thread pool. To find places in your code where you are creating threads, search for the string "ThreadStart."

Do you perform long-running blocking operations?

Avoid blocking operations in your ASP.NET applications where possible. If you have to execute a long-running task, consider using asynchronous execution (if you can free the calling thread) or use the asynchronous "fire and forget" model.

For more information, see How To Submit and Poll for Long-Running Tasks.

Related Items

For more information about the questions and issues raised in this section, see ASP.NET 2.0 Performance Guidelines - Threading.

Personal tools