Hacker News new | ask | show | jobs
by elcomet 538 days ago
What do you mean? Async/await uses threads
1 comments

I was trying to make sense of this sentence of the original commenter: "In new code I try to use threads, but certain things like yield which rely on async are simply too common and useful to stop using."

Seems to suggest that threads and yield/async were mutually exclusive. I misunderstood. I will move on.

They aren't mutually exclusive, but are two basically independent features. The way you would code for one and the other is completely different.
To use async await you have to execute the code in a run loop.
... and you can push CPU-intensive stuff off to a thread-executor to avoid blocking the async run-loop