logoalt Hacker News

alexeiz • today at 4:20 PM • 1 reply • view on HN

C++ async model is too complicated (and not cost free as claimed, since it allocates memory for the coroutine state) and as such it wasn't widely adopted. I don't see any code using C++ async (apart from libraries implementing "tasks" in various forms). At this point I view it as a failed experiment. My bet is that executors are going to replace async completely.


Replies

jandrewrogers • today at 4:32 PM

> since it allocates memory for the coroutine state

Heap allocation is not required, just the default.

You can do static allocation if you wish, though it is a little more complicated than typical static allocation due to the relative unpredictability.