¿Por qué Javascript SetTimeout () no es multiproceso?
Tengo un examen:
HTML:
<div id="f1">Empty</div>
<div id="f2">Empty</div>
js
var s1 = function() {
for (i = 1; i < 1000000000; i++) {
var b = i * i;
}
$('#f1').html('Set');
}
var s2 = function() {
if ($('#f1').html() == 'Empty') {
$('#f2').html('Multi Thread');
return;
};
$('#f2').html('One Thread');
}
setTimeout(s2,110);
setTimeout(s1,100);
¿Hay alguna razón real por la que setTimeOut () no se ejecute en subprocesos diferentes, como el modelo de evento?