XMLHttpRequest take 100% cpu during sync call
"Mcginkel" <[email protected]>
| Newsgroups | gmane.comp.mozilla.devel.xml |
|---|---|
| Organization | http://groups.google.com |
| Message-ID | <[email protected]> |
When I use the XMLHttpRequest to get data from a server synchroniously.
Firefox will use 100% cpu waiting for the request to finish.
This is a problem as the server and client machine are the same. The
server operation cannot perform as firefor tries to use the cpu 100%
while waiting..
I checked the code and found in nsXMLHttpRequest.cpp line 1532:
// If we're synchronous, spin an event loop here and wait
if (!(mState & XML_HTTP_REQUEST_ASYNC)) {
while (mState & XML_HTTP_REQUEST_SYNCLOOPING) {
modalEventQueue->ProcessPendingEvents();
}
mEventQService->PopThreadEventQueue(modalEventQueue);
}
This looks like a loop, but should this take 100% cpu ?
Is there something that can be done about this ? (apart from going to
async...) ?
regards,
Kees