4 ms·
> Very few actually understood that node is an event loop executing javascript backed by a threadpool for async operations. This is true, and that JavaScript i
by inglor 7y ago
> Very few actually understood that node is an event loop executing javascript backed by a threadpool for async operations.
This is true, and that JavaScript is mostly a synchronous programming language with host environments that can provide asynchronisity.
A caveat though is that the most important part of I/O is network I/O (tcp/udp sockets) and Node uses real async operations there rather than a threadpool.
FS is just really hard to get right in a cross platform way and that's why it's on the threadpool. Some other stuff like dns is also famously on the threadpool but tcp sockets are not - it's a big part of why Node is fast.