O'Reilly logo

JavaScript Concurrency by Adam Boduch

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Summary

This chapter introduced you to concurrency in NodeJS. The premise is that Node applications will perform a lot of IO, and that IO is slow, relative to other computations that take place in memory. Node implements an IO loop, a mechanism that notifies our code when a given IO resource is ready for input or output.

We saw some of the advantages and disadvantages to this model. The alternative approach involves relying on parallelism at the CPU level, which can pose challenges when there's lots of slow IO taking place. Conversely, the IO loop approach isn't impacted the same when there's lots of IO, but suffers greatly when there are expensive CPU tasks to perform.

We spent the remainder of the chapter looking at various network and file IO ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required