Re:Why choose async/await over threads?
by throwitaway1123 on Monday March 25, 2024 @09:22PM
(#39823336)
Most JS runtimes are multi-threaded behind the scenes. If you start a node process:
Then wait a second and run:
Or on macOS:
You'll see that there are multiple threads running, but like others have said, it's completely opaque to you as a programmer. It's basically just an implementation detail.
[ Parent
| on HN ]
Re:Why choose async/await over threads?
by throwitaway1123 on Tuesday March 26, 2024 @11:56AM
(#39829357)
If you need true parallelism of course you can opt-in to web workers (called worker threads in node), or the node-specific child_process.fork, or cluster module.