Wednesday, December 27, 2006

Asynchronous Web Page Programming in ASP.NET 2.0

Asynchronous programming allows a process to have multiple threads, enabling the process to do more than one action simultaneously. While asynchronous programmingcan be complicated, it can dramatically improve performance in situations where the process would otherwise need to wait for a relatively slow action, such as accessing a network resource, to occur.

For example, if you are creating a Web page that must query a network resource (such as a Web service), IIS and ASP.NET can only render a limited number of pages simultaneously.Therefore, the thread pool can become completely consumed, creating a performance bottleneck. Once the thread pool is consumed, your server waits for pages to finish rendering before beginning to process other pages. Even though the server might have available processor cycles, requests are queued. By enabling asynchronousWeb page programming, the server can begin rendering more pages simultaneously,improving efficiency and reducing page rendering time.