Reputation: 9185
More or less I want to execute two functions in parallel. One way as I see is doing through SetTimeOut function.
I have not completely gone through the ReactiveExentension, although it looks promising but may be overkill for my needs.
Is there any framework which supports parallelism ?
My use case is trivial, but I would like to know if anybody heavily needed parallelism in Java Script ?
Thanks, Biswanath.
Upvotes: 0
Views: 395
Reputation: 3138
You're not going to manage to put your program into a new thread unless the browser lets you do it and the only way that I can see that being plausible (assuming the browser doesn't provide some specific JavaScript extensions) is if it creates a new thread/process for each frame.
That said, you could likely have two scripts run alongside each other, simultaneously, by putting them into different frames, or iframe
s. Simply create multiple, invisible iframe
s on your web page and into each load a HTML document with your own JavaScript functions. Of couse you're not going to be able to tell the any of these pages to start processing something, but you could have them poll the top window for something to do then do their thing and then tell the top window when it's finished.
Just an idea.
Upvotes: 2