News for hackers. Stuff that matters.
Re:C++20 has been approved by gpderetta on Wednesday September 09, 2020 @07:50AM (#24419985)
std::future/promise is hopelessly inefficient, but the new executor framework being proposed for C++23 does provide for lazy evaluation of futures (or its equivalent). In fact lazy evaluation is the default. Executors can interface with coroutines (although the impedence mismatch is real) and the interface is powerful enough that allocation can be avoided in many cases (not via compiler optimization which I find too fragile), but via being able to inplace construct the coroutine frames in other existing regions of memory.

I was very critical of the C++ coroutine design as the extension interface feels very ad hoc and not built from first principles and because of the hard to avoid memory allocation, but people that know better than me seem to think that it is usable in practice with good performance.

I do believe that thread hopping is quite important in case you need access to remote data and want to avoid mutual exclusion.

There are no comments on this comment yet.