Re:A Universal I/O Abstraction for C++ (2020)
by gpderetta on Monday April 19, 2021 @03:20AM
(#26859918)
The proposed async "framework" happens to work well with coroutines, but they are not required (and infact most of the papers on the topic deal with them only in passing). You can build the async graph as an expression template and if you want, each operation (including the while loop) can be expressed as a different type.
I don't think coroutines provide (yet) enough introspection to break them down in the same way.
I would find that to be great, but I don't understand how.
In e.g.
how can you get a meaningful "graph" object out of that, e.g.[wait 100] -> [write 9] -> [wait 100] -> [write 8] -> ...
without actually "running" the code first to go through the co_await, which are the only way to acquire the information of what is to run ?
for instance, let's say that I want to compute "statically" (not in the "at compile time" sense but in the "after knowing the inputs to the program and before actually running the scheduler") how many [write] calls there are to schedule (assuming no cycles / infinite loops).