I listened that javascript is single threaded am I right?
Then how can I implement execution of functions(multiple) in parallel(simultaneous).
I have script as shown below, and I want to tell you that each xml file size is 4.6MB.
myfunction('sample1.xml');
myfunction('sample2.xml');
myfunction('sample3.xml');
.
.
myfunction('sample15.xml');
function myfunction(name) {
$.ajax({
type: "GET",
url: name,
dataType: "xml",
success: parseXml
});
function parseXml(xml) {
//searching the xml file
}
}
My aim is to speed up the process of searching xml file, for that I have thought that parallel execution is good. So is it possible to have parallel execution in javascript functions or is their any way to speed up my functions execution.