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

Force-stopping a coroutine #6

Open
nelsonxb opened this issue Jan 29, 2020 · 1 comment
Open

Force-stopping a coroutine #6

nelsonxb opened this issue Jan 29, 2020 · 1 comment
Labels
category:enhancement New feature or request priority:wanted This would be nice to have at some point

Comments

@nelsonxb
Copy link
Owner

The documentation currently states that while green_await(NULL) is a really bad plan, it may be used in future to exit early from a thread (and clean it up).

This does honestly sound incredibly dodgy to me, but I can't shake the feeling that it might end up being necessary in some weird use-case.

@nelsonxb nelsonxb added category:enhancement New feature or request priority:wanted This would be nice to have at some point labels Jan 29, 2020
@nelsonxb
Copy link
Owner Author

Although... just because we might be able to clean up the coroutine stack properly, doesn't mean resource leaks are avoided. User code may have all sorts of resources held, and at least by specifically documenting this as a Bad Idea All Around, we're discouraging behaviour that may lead to leakage for the careless, meanwhile explicitly supporting that use-case may create a false sense of security.

Maybe the correct answer to force-cancellation is C++ exceptions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:enhancement New feature or request priority:wanted This would be nice to have at some point
Projects
None yet
Development

No branches or pull requests

1 participant