-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Tasks should not hold a ref to their parent #1789
Comments
I am not sure... I rather think that parents with outstanding supervised children should not be considered dead until those children are dead (in particular, they should not send out their join message, because even if they succeed, they may yet fail due to failure propagation). Of course this doesn't mean that the parent's resources shouldn't be collected, but the child will probably need sort of ref. |
I should point out that the reason I brought this up now is because tasks keep their schedulers alive, so now we can have zombie tasks holding onto entire threads. |
hope it's ok if I take this out from under you. the new linked failure should subsume this. |
Fixing this bug will make this no longer segfault.
|
Also, after fixing this, I believe nothing will ever refcount a task apart from itself (well, its sched_loop is the one that derefs it, but same thing)? I'll leave the refcount in in case it's needed for work stealing, I think. It's an atomic operation but it won't cost anything because it never contends. |
Note: #2671 required making use of the reference count, so it still isn't deadcode. |
I'm glad to see this issue fixed. |
When running MIR Linker with multiple targets (e.g., unit tests), we were failing to compile since the call to `cargo rustc` would have multiple targets. Invoke separate calls for each target for now.
Tasks are reference counted and every child task holds a reference to its parent until the child is destroyed or becomes unsupervised. This could have many bizarre consequences, keeping lots of resources around long after they should be released.
The text was updated successfully, but these errors were encountered: