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

Implement the task tree and task killing using messages #1189

Closed
brson opened this issue Nov 18, 2011 · 2 comments
Closed

Implement the task tree and task killing using messages #1189

brson opened this issue Nov 18, 2011 · 2 comments
Assignees
Labels
A-runtime Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows

Comments

@brson
Copy link
Contributor

brson commented Nov 18, 2011

Right now killing a task means setting a flag on it in the runtime and checking that flag before and after yielding. There is at least one race condition that could result in the task not being killed and never waking up.

Seems like we should be able to maintain the relationships between tasks just using Rust messages. This is desirable because every bit of synchronization we eliminate from the runtime makes it easier to understand. There are some obstacles to being able to implement this though, primarily that we need to be able to select on multiple ports. Additionally, I don't really envision how reparenting would work.

@brson
Copy link
Contributor Author

brson commented May 4, 2012

I don't anticipate this happening in the 0.3 timeframe

@bblum
Copy link
Contributor

bblum commented Jul 24, 2012

I've implemented linked failure using an exclusive ARC per task-group (soon to be several per), rather than messages. Killing is done with a call into the runtime, rust_task_kill_other (and in rare cases, rust_task_kill_all).

A problem with implementing this using messages is that to be killed at any time, a task must always be implicitly reading from some sort of failure port. This could maybe be done to allow tasks to get kicked awake from blocked-on-ports, using "implicitly select2(port, failure_port)" -- but starts getting fuzzier when compiler-inserted yield checks come into play.

So I think using the current model of the exclusive arc, the kill_other builtin, and checking for killed at yield-points is the way to go, instead of messages.

Feel free to reopen if you disagree.

@bblum bblum closed this as completed Jul 24, 2012
bjorn3 added a commit to bjorn3/rust that referenced this issue Aug 6, 2021
celinval pushed a commit to celinval/rust-dev that referenced this issue Jun 4, 2024
Kobzol pushed a commit to Kobzol/rust that referenced this issue Dec 30, 2024
This allows loading the sources for crates loaded from the sysroot.
bors pushed a commit to rust-lang-ci/rust that referenced this issue Jan 2, 2025
This allows loading the sources for crates loaded from the sysroot.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-runtime Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows
Projects
None yet
Development

No branches or pull requests

2 participants