Async Pages in ASP.NET 2.0

One of the cool new advanced features in ASP.NET 2.0 is support for pages that execute otherwise blocking operations asynchronously.  This allows ASP.NET to re-use the worker thread while waiting for a completion (for example: calling a remote web-service and waiting for the response) and allows the server to execute much more efficiently.

Jeff Prosise now has a great article on MSDN that describes how it works and how you can take advantage of it:  http://msdn.microsoft.com/msdnmag/issues/05/10/WickedCode/default.aspx

 

Published Wednesday, October 12, 2005 9:55 AM by ScottGu

Comments

# re: Async Pages in ASP.NET 2.0

Thursday, October 13, 2005 1:48 AM by LukCAD
Yes, the requests of remote web services or remote databases are I/O bounded and we can get 503 "Server Unavailable" errors if a lot of opened requests not have their finish yet. And seems the IAsyncResult to help in this situation, the timeout to do it executable in any case. But what will happen if the server will overloaded by opened threads before we catch the timeout by our application?
Sincerely, LukCAD

# re: Async Pages in ASP.NET 2.0

Thursday, October 13, 2005 2:10 AM by scottgu
Hi Luk,

The nice thing about this feature is that you actually *aren't* creating new threads when calling the web-service requests. Instead, the current thread doesn't block and is able to be re-used to process a different request. ASP.NET can then use the I/O completion feature of Windows to receive a notification when the data returns, and re-schedule the next available thread to process it. This ends up being very efficient, and can scale to tons of concurrent web-service requests.

Hope this helps,

Scott