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.
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.
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.
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.
I know this isn't really an "answer", but here's some useful reading if you haven't already discovered it on your own:
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