News for hackers. Stuff that matters.
Re:Asynchrony Is Not Concurrency by Yoric on Saturday July 19, 2025 @05:59AM (#44614072)
Yeah, I'm insisting because I recently reviewed a PR with async code calling blocking code, which made the entire exercise pointless. And that was from an experienced dev.

There used to be a few compilers that used static analysis to predict the cost of a call (where the cost of I/O was effectively considered infinite) and in which you could enforce that a branch only had a budget of N. Modern architectures tend to mess up with any finite value of N, but you could fairly easily adapt such techniques to detect unbounded values.

Re:Asynchrony Is Not Concurrency by YZF on Saturday July 19, 2025 @02:51PM (#44618252)
The entire point might be to offload the blocking call and do something else while it's blocking.

There's a style of "asynchronous programming" where everything is designed to be non-blocking and there can be asynchronous programming with blocking code. In fact the first style can be emulated by offloading every blocking call to a different thread/greenthread/fiber and that's basically what's happening under the hood unless there is some fundamental support for non-blocking at the lower levels (sometimes all the way down to the hardware).