In this chapter, we introduced the concept of parallel execution using web workers. Before web workers, there were no means for our JavaScript to utilize the multiple CPU cores found on most hardware today.
We started off with a high-level overview of what web workers are. They're operating-system-level threads at their foundation. From a JavaScript perspective, they're event targets where we can post messages and listen to message
events. Workers come in three varieties—dedicated, shared, and sub-workers.
You then learned how to communicate with web workers by posting messages and listening to events. You learned that there's a limitation in place in terms of what can be passed in a message. This is due to the fact that all message data is serialized and reconstructed in the target thread.
We wrapped up the chapter with a look at how to go about handling errors and exceptions in web workers. In the following chapter, we'll address the practical aspects of parallelization—the types...