-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Discussion for "C++ Coroutines: Understanding the Compiler Transform" #6
Comments
Can you add permalinks to the section headers? e.g. I can manually link to, let's say, Step 6 by going through the html source but it'd be nice if there were just a link right there. Something like this?. Also, given the length, a table of contents would be 👌. I'm sure there's some plugin somewhere you can add to do that easily, I just don't know what that is. |
@brevzin Thanks for the tip. I've added anchor links and a table-of-contents now. |
very good post! Step 13: Implementing symmetric-transfer and the noop-coroutine this is a loop in coroutine_handle resume function,so how can the compiler implement with tail-call? |
There is no guaranteed tail-calls with C++ at the moment. |
Hello lewissbaker, |
I think there is a conflict with your previous post. In the section "Handling exceptions that propagate out of the coroutine body" of the post Understanding the promise type , you said
But in this post, when you put the try {
// ...
} catch (...) {
try {
state->__promise.unhandled_exception();
} catch (...) {
state->__suspend_point = 2;
state->__resume = nullptr; // mark as final-suspend-point
throw;
}
} This will not cause the coroutine automatically destroyed before return to the caller/resumer. It makes this coroutine in the 'suspended' state and propagate the exception to the caller/resumer. So which one is the current Coroutine TS wording to the behavior of rethrow exception in |
Discussion for the post at https://lewissbaker.github.io/2022/08/27/understanding-the-compiler-transform
Also see:
Reddit: https://www.reddit.com/r/cpp/comments/x0bj5z/c_coroutines_understanding_the_compiler_transform/
HackerNews: https://news.ycombinator.com/item?id=32642832
The text was updated successfully, but these errors were encountered: