Web Workers and WebAssembly

Web Workers allow you to utilize threads in the browser, which can improve the performance of your application by offloading some of the logic from the main (UI) thread. Worker threads are also capable of performing I/O using XMLHttpRequest. Worker threads communicate with the main thread by posting messages to an event handler.

Web Workers allow us to load Wasm modules into separate threads and perform operations that don't hinder the performance of the UI. Web Workers do have some limitations. They're unable to directly manipulate the DOM or access some of the methods and properties on the window object. The messages passed between threads must be serialized objects, which means you can't pass functions. Now that you know what a worker is, let's discuss how to create one.

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

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