We can create a new instance of a web worker as such:
var worker = new Worker('task.js');
Are each web worker backed by its own native thread, or is there a pool of native threads allocated per window which all web workers of that window will then share?
Are there standard implementation guidelines that browsers are supposed to follow?
What about the state of popular browsers like Chrome, FireFox, etc?
The W3C standard says this about Web Workers execution context:
Create a separate parallel execution environment (i.e. a separate thread or process or equivalent construct), and run the rest of these steps asynchronously in that context.
Essentially, a browser can implement this however it pleases. Any, or all, or none of your suggestions may apply.
Here's the reference: http://www.w3.org/TR/workers/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With