I still heard workmate saying that NodeJs is mono-thread. Well, it’s not quite true…but not quite wrong either.
The thread is often named as the loop event thread and it’s genuine role is to process events. A schema, that can be find in multiple places on Internet, offers a good overview of threads interaction:
Have you notice the use of callbacks ? Whenever event loop calls an asynchronous function has the result, it calls the callback with the result. Behind an asynchronous function, you can find a C++ pool thread code.
Here is another Internet schema to clarify this:
See you and have a nice code. 🙋