Skip to content

Tasks and communication #15713

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

Closed
larsbergstrom opened this issue Jul 16, 2014 · 5 comments
Closed

Tasks and communication #15713

larsbergstrom opened this issue Jul 16, 2014 · 5 comments
Labels
A-concurrency Area: Concurrency

Comments

@larsbergstrom
Copy link
Contributor

Currently, any large program using tasks and channels will have a mixture of deadlocks and unpredictable task failures due to the interaction of task failure, channel communications, and asynchronous communication protocols.

Ideas in this space:

  • Controlled tear-down behavior, ala either the old linked task failure or something else easier to implement for a group of tasks.
  • Static protocol checking to ensure progress / avoid deadlock or livelock. Note that, unlike much of the existing literature, this needs to be robust in the face of both async. comm. and async. + multiple failures.

CC: @pcwalton

@aturon
Copy link
Member

aturon commented Jul 16, 2014

cc me

@thehydroimpulse
Copy link
Contributor

/cc me

@thestinger
Copy link
Contributor

Controlled tear-down behavior, ala either the old linked task failure or something else easier to implement for a group of tasks.

Linked failure / thread cancellation doesn't work out well in a native language. The only way to do it is adding failure points where it gets checked, but adding that kind of overhead to Rust's standard library isn't going to be acceptable and it isn't going to be able to reliably fail without the compiler inserting dual use yield points (not going to happen).

Static protocol checking to ensure progress / avoid deadlock or livelock. Note that, unlike much of the existing literature, this needs to be robust in the face of both async. comm. and async. + multiple failures.

Can this be done in a syntax extension? It doesn't necessarily have to live in this repository.

@thestinger thestinger added A-libs A-concurrency Area: Concurrency labels Sep 16, 2014
@brson brson added the A-servo label Sep 16, 2014
@larsbergstrom
Copy link
Contributor Author

Indeed, we have largely abandoned the Kill-Safe Abstractions runtime approach to task failure handling, as Rust has moved in a different direction. Below is some info from communication with some external researchers we're trying to convince to look at this problems with us. We'll see if we can come up with a solution that's independent of Rust itself.

We have a couple of big challenges with our use of concurrency in Servo today:

  1. Isolation of communication

We use lightweight tasks (similar to CML threads) heavily to
partition the browser in a set of concurrent threads (e.g. the
JavaScript task, the rendering task, and the task for laying out the
page). We would like to ensure that all communication within certain
subsets of these tasks does not escape to the broader architecture.
This constraint would allow an outside managing task to detect when
some member of a subgroup of tasks has generated an exception
(failed, in Rust parlance) and easily shut down the entire subgroup,
without risking "spreading" the failure to the rest of the system via
channels that have one end connected to a task that has exited.

  1. Eventual shutdown

We would like to at least show deadlock-freedom within our subgroup
of tasks. If they are all continuing to process events, then we have
reason to believe that they will eventually shut down if one task in
the subgroup shuts down (i.e., we don't leak any zombie tasks
continuing to take up memory but doing nothing useful).

We're very interested in ideas for tackling these problems. The first
seems like should be approachable with a straightforward type-based
analysis, but the second likely requires something much stronger,
though I'd love to be proven wrong.

@rust-highfive
Copy link
Contributor

This issue has been moved to the RFCs repo: rust-lang/rfcs#316

bors added a commit to rust-lang-ci/rust that referenced this issue Nov 13, 2023
…r=Veykril

Do flyimport completions by prefix search for short paths

Fixes rust-lang/rust-analyzer#15711
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-concurrency Area: Concurrency
Projects
None yet
Development

No branches or pull requests

6 participants