Chapter 8. Using the HTML5 Web Workers API

HTML5 Web Workers provide background processing capabilities to web applications and typically run on separate threads so that JavaScript applications using HTML5 Web Workers can take advantage of multicore CPUs. Separating long-running tasks into HTML5 Web Workers also avoids the dreaded slow-script warnings, shown in Figure 8-1, that display when JavaScript loops continue for several seconds.

Slow script warning in Firefox

Figure 8.1. Slow script warning in Firefox

As powerful as HTML5 Web Workers are, there are also certain things they cannot do. For example, when a script is executing inside an HTML5 Web Worker it cannot access the ...

Get Pro HTML5 Programming: Powerful APIs for Richer Internet Application 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.