Hacker News new | ask | show | jobs
by shock 2251 days ago
Why do you want db access to be non-blocking? Are you not interested in the result?
1 comments

I want to resume business logic when the result is available, but I don't want tens of thousands of kernel threads blocked on results until java finally gets fibers. People who write synchronous drivers also tend to make big poorly-used connection pools which defeat TCP flow control.
> I don't want tens of thousands of kernel threads blocked on results

If that is because of the memory consumption of kernel threads, be aware you are trading less memory consumption for increased cognitive complexity (if you agree that asynchronicity is more complex than synchronicity).

True, if hardware cost nothing we might still be on python. Chaining futures with f1.thenApply(arg -> f2) hasn't been that bad, but kotlin's coroutine DSL does look better.