I did years of multithreading (C, C#) before NodeJS (btw, NodeJS also has thread support).
The main problem with threads is switching between them. Each switch costs a lot of memory shifting and CPU cycles. Event loop is computationally cheap.
Hence, NodeJS is high performant in I/O heavy tasks (e.g. networking).
I'm a self-taught dev focused on websites and Python development.
My friends call me the "Data Genie".
When I get bored, I find tech to read about, write about and build things with.
Now I am curious why other languages don't do single threaded. or maybe it depends on the task and entire language setup. Or is it the difficulty of doing an event loop well that meant it took a long time for node to eventually be the first?
I'm a self-taught dev focused on websites and Python development.
My friends call me the "Data Genie".
When I get bored, I find tech to read about, write about and build things with.
I did years of multithreading (C, C#) before NodeJS (btw, NodeJS also has thread support).
The main problem with threads is switching between them. Each switch costs a lot of memory shifting and CPU cycles. Event loop is computationally cheap.
Hence, NodeJS is high performant in I/O heavy tasks (e.g. networking).
Ah okay thanks for explaining.
Now I am curious why other languages don't do single threaded. or maybe it depends on the task and entire language setup. Or is it the difficulty of doing an event loop well that meant it took a long time for node to eventually be the first?
Good questions. I wish I knew the answers.
Thanks for being open minded. You are a rare breed. 👍
I've updated my post to be more balanced and to point to your initial comment
Looks great! 👍👍👍