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

Dropping JoinHandle does not cause deallocation #23

Open
senyosimpson opened this issue Mar 4, 2022 · 2 comments
Open

Dropping JoinHandle does not cause deallocation #23

senyosimpson opened this issue Mar 4, 2022 · 2 comments

Comments

@senyosimpson
Copy link
Owner

When a task starts, it has a reference count of 2. If the JoinHandle is dropped, we can only run a task once before it gets deallocated (since a Task will cause a ref decrement on yield/completion). This is not correct. It should complete since it was not explicitly cancelled.

@senyosimpson
Copy link
Owner Author

Turns out this doesn't work in practice (in my executor). Reason being is that whenever a waker is registered, it is cloned. So we always end up with enough ref counts to keep a task valid. This may not always be true however but right now it is and therefore I can ignore this problem.

@senyosimpson
Copy link
Owner Author

yerrr this is gibberish to me now lmao

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