I have a server monitoring system that is fully AJAX. There is one xmlhttprequest object created when the page loads and it is used to check for new server status updates. The currently displayed information is POSTed to the script and it checks to see if there are any new updates. If not, the script will sleep for 20 seconds and try again, if there are new updates it will return the new alerts. The problem is whenever this AJAX request is still loading any other xmlhttprequests will wait until the other status checking thread returns a value. Any idea why this is happening? For all other requests a new xmlhttprequest object is created so none are reused. Thanks in advance for the help!
Javascript is the problem, it is single threaded. it can only do one thing at a time when javascript is running all other prcesses are paused until it completes.
the xmlhttp objects can be processed at the same time when the async option is set to true. In that case the request will be sent off and other JS can be processed and when the state of the request changes it will run the function set for the xmlhttprequest.onreadystatechange value.