DEV Community


Discussion on: Prove that JavaScript runs in a single thread

rvilgalys profile image

JS has an event loop that allows for async execution on a single thread (the youtube talk at the end of the post is a great resource on this). IO and garbage collection are actually handled on different threads though.

One advantage here is that other server languages dedicate a new thread per request and so end up bound to hardware limitations for even simple requests at high enough volume. Node.js allows you to scale up as needed (and being single threaded, it's easy to run many instances in parallel).

anshulnegitc profile image
Anshul Negi

Ooo man I was in such a rush to finish this post that I missed the video link.
Thanks for pointing out.