Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are web workers green or red?

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?

like image 463
Pacerier Avatar asked Oct 13 '25 02:10

Pacerier


1 Answers

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/