Concurrency in NodeJS world

2019, Nov 10

What is Concurrency?

Concurrency is when a set of tasks can start, run, and complete in overlapping time periods. The tasks may never run at the same time, but they could. Parallelism, on the other hand, is when a set of tasks are running at the same time.

Node.js has an event-loop which manages at most one thread at any point in time. , which of course means a single call stack. By that same logic, an important thing to note is that the event loop can only ever do one thing at once.

Node.js is single-threaded. Before I talk about what that means, let’s talk about concurrency. It seems a lot of folks get the wrong idea about concurrency, assuming that it’s exactly the same thing as parallelism. The terms are actually related, but they’re not the same.

TBC...

Conclusion

Thank you for reading! Let me know what you find simple or hard about Concurrency in node.