Hacker News new | ask | show | jobs
by nightski 1722 days ago
Concurrency does not require multi-threading. Maybe you mean parallelism? Concurrency can still be really valuable in the context of a single threaded application.
2 comments

If a program wants to perform a task in an async way without delegating it to an external program (like a database server or the OS' I/O system), it has to use threads, right? I think the point is that concurrency, for some tasks, basically requires multithreading. Not for the parallelism benefits, but just to be able to make concurrency possible for a task that requires blocking a thread.
Concurrency is more about having order independent units of computation. You can concurrently run operations on a single thread, although there is less benefit if no IO is involved. It's not something you'd likely do in practice unless there was IO.
I did mean parallelism, but I think the point stands. There's very little practical use of async await outside of multithreading.
Syntax sugar aside. Wasn’t the simple scalability of single threaded async nodejs main selling point?