Skip to content
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

stack-like coroutine frame memory allocation #222

Open
microcai opened this issue Nov 4, 2024 · 0 comments
Open

stack-like coroutine frame memory allocation #222

microcai opened this issue Nov 4, 2024 · 0 comments

Comments

@microcai
Copy link

microcai commented Nov 4, 2024

when coro foo calls (or, precisely speeaking, awaits) bar, and bar awaits bob, the coro frame is allocated in foo, bar, bob order, and when their job done, the deallocating happens just in "reverse" order.

it works much like stacks, just with "final await to continuation ", not "ret".

logically speaking, it is a stack.

so, how about implementing promise type allocation with a stack like allocator ? And this allocator shall be "shared" with coroutines on the "same" call chain, aka, "a coperative user mode thread".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant