- Why JavaScript Concurrency? JavaScript isn't what comes to mind when we think about concurrent programming languages. Yet, there's a ton of valid use cases for concurrency in JavaScript, and in recent versions of the language, we can actually write concurrent code.
- The JavaScript Execution Model: What's actually happening in the browser when we're making an API request, or when we're scheduling a function call using
setTimeout()
? The nature of JavaScript engines has a strong influence over the kind of concurrent code we can write. - Synchronizing with Promises: Promises are the key to enabling concurrency by default in JavaScript code. Whether we're synchronizing network requests, web worker data, or both, we can use promises to hide this messy synchronization logic.
- Lazy Evaluation with Generators: Generators are used to conserve on CPU and memory by not doing things — being lazy in other words. We use generators to execute different pieces of code concurrently, to cooperatively find the most efficient approach.
- Working with Workers: Web workers are how we get true parallelism into our applications. JavaScript code does a lot of work in the browser, compared to 10 years ago — it needs all the help it can get from the CPU.
- Practical Parallelism: Using concurrency to solve the right kinds of problems. It boils down to writing code that's concurrent by default — this is very difficult if we try to parallelize every problem.
- Abstracting Concurrency: The best way to write concurrent code by default is to not have to write concurrent code at all. When our concurrency abstractions are consistent, the actual problem of concurrency fades into the background, allowing us to focus on code that matters — delivering features.
- Evented IO with NodeJS: The IO event loop in NodeJS is how we write concurrent JavaScript code for the back-end. It's essential to understand how this mechanism works in a web environment where there's lots of IO.
- Advanced NodeJS Concurrency: Node isn't limited to an IO event loop as it's only means of concurrency. Process clusters and micro-services also just two of the advanced approaches to concurrency with Node.
- Building a Concurrent Application: The only way to proficiency with any programming technique is to use it to build applications. Nowhere is this more true than with understanding the implications of concurrency in a JavaScript application.
Monday, December 14, 2015
JavaScript Concurrency
I'm pleased to announce my latest book — JavaScript Concurrency — from Packt Publishing and available on Amazon. This is unique book in that it's more than just a basic rundown of all the concurrency features available to our JavaScript code. Instead, the book uses features like promises, generators, and web workers, as teaching tools for thinking concurrently. There's no shortage of concurrency books out there that teach us how to think in terms of concurrency. This one is specific to JavaScript, and the theme aim is to show you how to write JavaScript code that's concurrent by default, instead of a bolt-on capability. Here's an overview of the chapters:
Subscribe to:
Post Comments
(
Atom
)
No comments :
Post a Comment