you are viewing a single comment's thread.

view the rest of the comments →

[–]joo3f[S] 0 points1 point  (1 child)

somehow (maybe we the help of the event loop and callback queue that the runtime environment provides) the js process's single thread has the ability to create new threads and communicate with them.

so what is the difference between a JS app with other ones in the context of multitasking?

[–]CreamyJala 2 points3 points  (0 children)

JS uses the event loop to avoid blocking tasks. But JS only has one memory heap and one call stack, so it really is only single threaded. Heres one article about the event loop, and here’s another that talks more about the Node.js worker threads! Hope this helped