locked
asp.net async pages, implementation details RRS feed

  • Question

  • User481826200 posted

    A short while back ago I came across an excellent article by Jeff Prosise (http://msdn.microsoft.com/msdnmag/issues/07/03/WickedCode/). The article basically talks about asp.net asynchronous pages. An excerpt from the article is as follows:

    "When the request arrives, it's assigned a thread by ASP.NET. The request begins processing on that thread, but when the time comes to hit the database, the request launches an asynchronous ADO.NET query and returns the thread to the thread pool. When the query completes, ADO.NET calls back to ASP.NET, and ASP.NET grabs another thread from the thread pool and resumes processing the request."

    What I'm really interested in knowing is how is it that ASP.NET delays page processing until any registered async operations complete? In other words, the process of returning the executing thread back to the pool, delaying the client request until the async operations complete, notification that the async operations have completed, and then finally grabbing another thread from the pool to resume processing, how is this all accomplished? Anyone have any ideas?

     

    Thanks

    GA

    Tuesday, April 24, 2007 11:36 AM

All replies

  • User390817712 posted

    It's using some of the Asynch design patterns in .NET: delegates, callbacks, and the IAsyncResult interface: http://msdn.microsoft.com/en-us/library/aa719595(VS.71).aspx

    Tuesday, April 24, 2007 3:29 PM
  • User1581566483 posted
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=Content-Type content="text/html; charset=iso-8859-1"> <META content="MSHTML 6.00.5700.6" name=GENERATOR> <STYLE></STYLE> </HEAD> <BODY bgColor=#ffffff>
    May be WaitCallback ? I am not sure.

    --
    Vadivel Kumar
    http://weblogs.vadivelk.net
    [Mark this reply as answer if you found it useful, so that every one can easily find the answer]
    </BODY></HTML>
    Friday, April 27, 2007 10:29 AM