5 ms·
boost.coroutine can be optionally used with segmented stacks. Copyable stacks are a problem in C++ as objects can have custom copy semantics. Anyway, large sta
by gpderetta 10y ago
boost.coroutine can be optionally used with segmented stacks. Copyable stacks are a problem in C++ as objects can have custom copy semantics.
Anyway, large stacks (assuming you want at least 1 page per coroutine) do not waste memory, they only waste address space which is plentiful. If you want slim coroutines, there are the shallow generator style coroutines of the other proposal.
There is some hope that we will have the best of both worlds, stackful coruoutine semantics plus annotations to opt in to the stackless coroutines optimization.
- wahern 10y agoThere is some hope that we will have the best of both worlds, stackful coruoutine semantics plus annotations to opt in to the stackless coroutines optimization. That would be pretty amazing. Are there proposals or committee discussions you could link to? If C++ got stackful coroutines I might finally make the switch from C.
- medi11 10y agohttp://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0534r0.pdf http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p053... call/cc is the basic mechanism - useful to implement stackful coroutines and fibers (cooperative multi-tasking)