Parallel Wasm with Web Workers

The process of building a complex application that performs heavy computation or other resource-intensive work can benefit greatly from using threads. Threads allow you to perform operations in parallel by dividing functionality among tasks that run independently. At of writing this, support for threads in WebAssembly is in the Feature Proposal phase. In this phase, the specification hasn't been written and the feature isn't implemented. Fortunately, JavaScript provides threading capabilities in the form of Web Workers. In this section, we'll demonstrate how to use JavaScript's Web Workers API to interact with Wasm modules in separate threads.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset