View Single Post
  #3 (permalink)  
Old May 26th, 2009, 08:23 AM
fullingdale fullingdale is offline
Authorized User
Points: 169, Level: 3
Points: 169, Level: 3 Points: 169, Level: 3 Points: 169, Level: 3
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Apr 2008
Location: Northampton, , United Kingdom.
Posts: 35
Thanks: 1
Thanked 0 Times in 0 Posts

Thank you for the response, but I think that I may not have been clear in my explanation.

It's not so much what the back-end (ASP) process is doing, it's the fact that I am trying to make multiple hits to "???" and not have the page waiting around for all of the results before displaying something. The cheesy "do...while" was just there to simulate the fact that "???" will have an unpredictable response time.

I found that with a little poking around, my code example actually works ... ONCE ... the http objects would need to be disposed of, and re-instantiated for the results to work again, in the same instance.

However, further reading tells me that within IE, Microsoft have followed the HTTP structure to the letter and only allow two asynchronous connections in this fashion, thereby when I try to obtain results from FIVE sources with a gadr-coded delay factor:

Source (hard coded delay)
SRC1 : 5 minutes
SRC2 : 10 minutes
SRC3 : 15 minutes
SRC4 : 20 minutes
SRC5 : 25 minutes

The results that I get are along the lines of

Start at 10am precisely.
SRC1(5) starts
SRC2(10) starts

SRC1(5) completes and displays results
SRC3(15) starts

SRC2(10) completed and displays results
SRC4(20) starts

SRC3(15) completes and results display
SRC5(25) starts

SRC4(20) completes and results display

SRC5(25) completes and results display

So you see that all five results come back quicker (45 minutes) than a synchronous solution (75 minuets), but what I would be aiming for (as my ideal) would have been:

SRC1(5) starts
SRC2(10) starts
SRC3(15) starts
SRC4(20) starts
SRC5(25) starts

SRC1(5) completes and displays results

SRC2(10) completes and displays results

SRC3(15) completes and displays results

SRC4(20) completes and displays results

SRC5(25) completes and displays results

Where all of my results have been processed and displayed on screen as and when available, with the slowest one appearing at the 25 minute mark.

... we see the reasoning for IE having this limi of two threads, as a situation of 100 users clicking, would have the effect of 500 clicks ... and having negative effect on the server performance. Blah, blah...

I have found information which suggests the answer to be using "Asynchronous PreRequest Handler Execution", but I can only find one good article on it ... and can't find a working example of the code to use, which is now my next question, but to keep things appropriate ... I'll start a new thread on that.