Ben Kolera wrote:
Quote:
As far as AJAX is concerned, I am not so concerned about
the concurrent data access problems (dining philosphers,
anyone?) inherent to multithreaded programming,
Javascript is not multithreaded. (it is just about possible that
multiple frames may operate as multiple browser instances and for the OS
to multitask them, but there is no evidence for that being true in any
existing browsers, though an increasing use of duel core processors may
encourage browser to go in that direction).
Quote:
but am worried, rather, about the sheer lack of
documentation detailing the behaviour of javascript
in such situations.
Javascript is not multithreaded, how much else needs to be said?
Quote:
For example, if I have two XMLHttp objects, for which I need
both loaded to continue processing:
>
var XMLHttp1 = XMLHttpRequest();
var XMLHttp2 = XMLHttpRequest();
>
xmlHttp1.onreadystatechange= handle;
xmlHttp2.onreadystatechange= handle;
>
... //snip code for sending the request
>
function handle() {
if(xmlHttp1.readyState == 4 && xmlHttp2.readyState == 4) {
... // snip code for continuing the processing of data
}
}
<snip>
Quote:
... . What constitutes as
an atomic instruction in javascript?
<snip>
Executing javascript is never interrupted by event triggered (such as
onreadystatechange) code, instead the event has to wait until the
running code finishes before it can start being executed.
Richard.