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

Stackfull or stackless? Also comparison vs. Rust RFC2033 #11

Closed
cameronelliott opened this issue Nov 16, 2022 · 3 comments
Closed

Stackfull or stackless? Also comparison vs. Rust RFC2033 #11

cameronelliott opened this issue Nov 16, 2022 · 3 comments

Comments

@cameronelliott
Copy link

This looks amazing! Thank you for developing it.

I'm learning about a coroutines and generators under Rust,
and that's how I discovered this. (I'd like to use them for protocol implementation)

I wonder if you could share a bit about Corosensi vs the unstable generators feature in Rust.
Like, it is stackfull, or stackless: link

The features are covered well in the readme, but I just wonder if you would consider
writing a bit more about the implementation, and and comparisons to the unstable generators.

Thank you

@cameronelliott
Copy link
Author

One more thought, the Stackoverflow article linked above says:

Without stackfulness and first-class semantics, some useful execution control flows cannot be supported (for instance cooperative multitasking or checkpointing).

So, maybe Corosensi is both stackful, and provides first-class continuations?, which means effectively full cooperative multitasking and checkpointing are possible?? I'm not really sure.

Thanks.

@cameronelliott
Copy link
Author

Goodness, sorry. I've been reading a bit more. I guess stackful coroutines are the same as Goroutines, or green threads. I was confused, and thought all coroutines were kept on the same stack. Apparently not.

@Amanieu
Copy link
Owner

Amanieu commented Nov 18, 2022

Yes this crate only provides stackful coroutines. You can build a cooperative scheduler on top of it, but this crate only provide the low-level (but safe) task switching functionality.

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

2 participants