© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2023
J. SimpsonHow JavaScript Works https://doi.org/10.1007/978-1-4842-9738-4_14

14. Web Workers and Multithreading

Jonathon Simpson1  
(1)
Belfast, Antrim, UK
 

Most implementations of JavaScript are single-threaded, with some exceptions. As JavaScript has begun to do more and more in terms of computation, the fact that a lot of processing is confined to a single thread has become somewhat limiting even with Web APIs to bear some of that load. On a single thread, for example, poorly written but computationally intensive code can stop the entire application from working.

To solve this problem and many more, the Web Workers API has been designed to give JavaScript a ...

Get How JavaScript Works: Master the Basics of JavaScript and Modern Web App Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.