Hi, coroutine listers!
The example is very awesome. but after reading though the source, i have
a question:
Is any limitation makes a push_coroutine must be caller and
pull_coroutine must be the coro?
This way, we have to yield out at the first line of coroutine function by
calling caller(), just like the example showed:
typedef coroutines::pull_coroutine<void> coro_pull;
typedef coroutines::pull_coroutine<void> coro_push;
auto asynchronous(F f) -> future
On Fri, Jun 20, 2014 at 9:39 AM, bbxiong
Is any limitation makes a push_coroutine must be caller and pull_coroutine must be the coro?
Why not swap coro_pull and coro_push like this:
...
This still works on my machine, and has no extra "call to caller()", push_coroutine is not invoked until we explicitly run it (while pull_coroutine is invoked in constructor).
So, my question is, s there any bad effects by using coroutines in this way?
Without having read through your change carefully, my thought is that it should be fine. The await_emu example is a proof of concept. If the change works on your machine, it's probably okay.
participants (2)
-
bbxiong
-
Nat Goodspeed