Jump to ratings and reviews
Rate this book

Web Workers: Multithreaded Programs in JavaScript

Rate this book
Web apps would run much better if heavy calculations could be performed in the background, rather than compete with the user interface. With this book, you’ll learn how to use Web Workers to run computationally intensive JavaScript code in a thread parallel to the UI. Yes, multi-threaded programing is complicated, but Web Workers provide a simple API that helps you be productive without the complex algorithms.

If you have an intermediate to advanced understanding of JavaScript— especially event handling and callbacks—you’re ready to tackle Web Workers with the tools in this example-driven guide.


Start creating Web Workers and understand what they can and can’t do
Determine which browser versions support the API
Use dedicated Web Workers for tasks that consume a lot of CPU, such as data parsing
Explore use cases for creating inline Workers, such as encapsulating a web app in one page
Create a shared Worker to communicate multiple web app instances to the server, and other uses
Learn best practices for debugging Web Workers
Apply Web Workers within the server-side Node environment

62 pages, Paperback

First published April 22, 2012

15 people want to read

About the author

Ido Green

2 books

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
1 (4%)
4 stars
7 (28%)
3 stars
12 (48%)
2 stars
5 (20%)
1 star
0 (0%)
Displaying 1 - 6 of 6 reviews
Profile Image for Rob.
Author 2 books444 followers
September 4, 2012
short version: A good and pretty in-depth overview of the emerging Web Worker standard. But "in-depth" here fits into about 50 pages because the API design is so simple. I could have seen this as tightened up and folded into Nicholas Zakas' Professional JavaScript for Web Developers as a chapter.

--- long version: ---

Ido Green's Web Workers: Multithreaded Programs in JavaScript (O'Reilly, 2012) is a dive into the emerging API of Web Workers. It's a short book--at 46 pages, it may as well be a chapter from another technical book--but it's free of fluff, and laser focused on one topic, and one topic only. But this is just fine; we're only here to learn about Web Workers, after all.

Now, I don't want to give away the ending, but Web Workers are actually pretty simple to use. [1] There are a few important limitations to keep in mind (e.g., no DOM access, limited BOM access) but Web Workers are otherwise a great candidate feature in the "HTML5 technology constellation" to perform heavyweight, long-running tasks. Green's approach here is to provide simple explanations and then demonstrate the features in action with relevant code examples. With his explanations, you should be up and running with Web Workers in an afternoon.

That being said, I had a few minor quibbles closing the covers on this one. First, the sample code is available in a Github repo, but this isn't mentioned until the closing remarks in the final chapter; this is a non-sensical place for them, especially considering that there is already a perfect place to mention them in the preface. Second, some of the code examples as they appear in the book are either rough-around-the-edges or else incomplete; for example, Example 3-4 has a variable declared twice, and Example 5-1 is missing the style information (meaning your version doesn't look anything like the screenshot). I'm a bit of a pedant about these sorts of things, so they always rub me the wrong way, but they do not otherwise detract from the technical points that Green is trying to get a across in the book, so I won't hold that against him.

Recommended? If you need to come up to speed on Web Workers quickly without anything extra? Yes.

---

[1] Provided you're in a browser that supports them.
379 reviews10 followers
November 22, 2012
Una discreta introduzione ai web workers, ma da un manuale completamente dedicato solo a questa tecnologia mi sarei aspettato un maggiore approfondimento.
Le informazioni contenute in questo libro si possono trovare facilmente in un singolo post su qualche blog online, o in un capitolo di un moderno manuale su Javascript.
Profile Image for Andres  Sanchez.
18 reviews7 followers
February 26, 2014
Un libro muy fácil de leer. Probablemente sea lo mismo investigar en internet. El tema de Web Worker es muy interesante, así que les recomiendo aprender este tipo de tecnologías si están metidos en desarrollo web.
Displaying 1 - 6 of 6 reviews

Can't find what you're looking for?

Get help and learn more about the design.