Hacker News new | ask | show | jobs
by wmoss 5788 days ago
I think the move to async frameworks is primarily precipitated by the fact that a file handle (which is, essentially, what an async framework holds per connection) is substantially lighter weight than a thread. When you're talking about writing a server that can handle thousands of concurrent connections, threads just become computationally infeasible.
2 comments

That depends a lot on your OS and your threading mechanism. It used to be pretty bad on Linux for example, but the modern NPTL implementation is much better. And even then it still doesn't mean that your language has to stick to a 1:1 threading model.

The main problem with threads is the relative complexity of the programming and debugging model. I don't really see a complete migration from threads to async, I see a migratino from threads to a multitude of models, where async is just one of them.

Yes, that makes sense.

In my case, I ended up here by trying to dynamically shift where I'm applying the work load in the search space without pruning off an answer.