Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Has anybody ever done large searches in JavaScript using webworkers to parallelize?

I'm writing a search function in JavaScript which is highly parallelizable, and operates on enormous data sets. The data sets are stored in trees of JS objects, and it could be implemented by partitioning the search into web workers.

Is anybody aware of products and/or research doing similar things? I'd like to read some experience going too far down the implementation path, but Googling has been totally unhelpful.

like image 849
Wes Avatar asked Jan 06 '12 16:01

Wes


People also ask

How many Webworkers can run concurrently?

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.

How do you destroy a Webworker?

From the main thread, you can terminate a web worker by calling the terminate() method of the Web Workers API: worker. terminate(); After terminate() is issued, the web worker is destroyed immediately without any chance of completing any ongoing or pending operations.

Can Webworkers access DOM?

Web workers can't access DOM elements from the web page. Web workers can't access global variables and JavaScript functions from the web page. Web workers can't call alert() or confirm() functions. Objects such as window, document and parent can't be accessed inside the web worker.


1 Answers

I know this isn't really an "answer", but here's some useful reading if you haven't already discovered it on your own:

  • Stack Overflow #1
  • Stack Overflow #2
  • Intel Article
like image 88
Bob FiveThousand Avatar answered Sep 21 '22 14:09

Bob FiveThousand