Hacker News new | ask | show | jobs
by gpderetta 3385 days 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.

1 comments

  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.
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.
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)