Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maximum running web worker html5 at the same

Is there any maximum count of web worker that can be run at the same time? Thanks a lot.

like image 980
user430926 Avatar asked Jun 15 '12 11:06

user430926


People also ask

How many web workers can run simultaneously?

A web worker is a JavaScript program running on a different thread, in parallel with main thread. The browser creates one thread per tab. The main thread can spawn an unlimited number of web workers, until the user's system resources are fully consumed.

Is HTML5 multithreaded?

Multithreading is supported by all programming languages and platforms. But HTML never supported it. HTML programmers had to use setTimeout or setInterval to make the application behave like multithread application. But HTML5 provided built in API to support multithreading.

What are the restrictions of web workers on DOM?

Limitations Of Web Workers The Web Workers API is a very powerful tool, but it has a few limitations: A worker can't directly manipulate the DOM and has limited access to methods and properties of the window object. A worker can not be run directly from the filesystem. It can only be run via a server.

What are web workers in HTML5?

A web worker is a JavaScript that runs in the background, independently of other scripts, without affecting the performance of the page. You can continue to do whatever you want: clicking, selecting things, etc., while the web worker runs in the background.


2 Answers

Yes and no. With Web Workers, there's no hard limit but you are limited by the available CPU and memory.

There's a rather large amount of CPU and memory overhead that comes with each worker so you can bring the machine to a grind if you spin off a lot of workers.

I'd say Web Workers are best used for "long running" background tasks of 100 milliseconds or more.

like image 73
buley Avatar answered Oct 06 '22 01:10

buley


The w3c doesn't mention any limitation (see http://www.w3.org/TR/workers/)

But it depends on what you are wanting to do, the limit will be the computer on which you will run the app (be kind with your users).

like image 30
Shahor Avatar answered Oct 06 '22 03:10

Shahor