Hi,
I use a lot asynchronous XMLHTTP from JavaScript. Are the callbacks
that we register with XMLHTTP guaranteed to execute single-threaded?
For instance, consider the following code snippet.
var xmlhttp1 = new ActiveXObject( "Msxml2.XMLHTTP .4.0" );
xmlhttp1.onread ystatechange = callback;
xmlhttp1.open( "POST", "foo.aspx", true );
xmlhttp1.send( data1 );
var xmlhttp2 = new ActiveXObject( "Msxml2.XMLHTTP .4.0" );
xmlhttp2.onread ystatechange = callback;
xmlhttp2.open( "POST", "foo.aspx", true );
xmlhttp2.send( data2 );
function callback()
{
//
// will two instances of this function run
// parallely?
//
}
Will the function "callback" be run parallelly should both the XMLHTTP
requests return simultaneously? Or does IE somehow serialize calls to
the callback routine? Its important for me that the callback executes
single threaded since things like critical sections aren't possible in
JavaScript.
Thanks.
--
Ranju. V
http://www.geocities.com/cool_ranju/