Chapter 11. Messaging and Web Workers

JavaScript presents us with a more or less single-threaded scripting environment. If we have work for the browser to do, such as tabulating numbers or processing image data, we have to wait for all of it to complete before we can continue on to another task. In times past (and in most cases today), this is just fine. Even on sites with a large JavaScript payload, such as The New York Times, there usually isn’t enough client-side JavaScript processing to necessitate concurrency.

As browsers take on a larger role as providers of powerful web applications, more work is expected to be done on client devices and the need for JavaScript ...

Get HTML5 Unleashed 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.