February 2018
Intermediate to advanced
298 pages
8h 22m
English
Simply put, a thread is a simple and independent snippet of running code. It is a container in which your tasks get executed. Before web workers, JavaScript provided just a single thread; that is, the main thread for the developers to do everything in.
This created some problems with advancements in tech. Suppose you're running a smooth CSS3 animation, and suddenly you need to do a heavy calculation on the JavaScript end for some reason. This'll make the animation sluggish if you do it on the main thread. However, if you offload it to a web worker that runs in its own thread, it will have no effect on the user experience.
Because web workers run in their own threads, they cannot have access to the ...
Read now
Unlock full access