C# Tutorial

An Interactive C# Tutorial, Covering Mainly C# .NET 2.0, C# ADO.NET, C# Threading, C# ASP.NET, and C# Syntax

C# Tutorial


 

Async Pages in ASP.NET

February 19th, 2007 · No Comments

One of the cooler things I’ve read about lately is Async Pages in ASP.NET 2.0.  The idea is that if you have long running IO bound tasks such as third party web service calls or database queries, the worker thread pool cannot reuse the thread running the IO bound task, so faster running tasks cannot be processed by IIS for other users of your web applications.

If you mark your page as Async=”True” in the Page directive, or set the IsAsync property programatically, you can then use Async calls.  In addition to freeing up the worker thread pool for other requests while doing long running IO operations, this exciting new feature of ASP.NET 2.0 also allows you to run IO operations in parrallel. 

 If you need to call 5 third party web services before rendering the page to the browser, and each third party web service call takes 5 seconds to complete, your users will need to wait 25 seconds to see the page output if you call all the web services serially.  If you use the Async Page feature, the page will render in 5 seconds, as each web service call will be processed asynchronously.  You can also specify timeouts for the operations.

A great article on this is here:

http://msdn.microsoft.com/msdnmag/issues/05/10/WickedCode/

[?]
Click Here To Share This With Other Popular Social Sites

Tags: C# Threading

0 responses so far ↓

  • There are no comments yet...Kick things off by filling out the form below.

You must log in to post a comment.