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

Fix lies in the concurrency guide. #16757

Merged

Conversation

steveklabnik
Copy link
Member

This cleans up blatant lies in the concurrency guide, and modernizes it
a bit. There's a lot more to do, but until I get to it, let's make it a
little bit better.

platform), and acquires more stack as needed.
Unlike in languages such as C, a Rust task cannot accidentally write to
memory beyond the end of the stack, causing crashes or worse.
Rust provides safe concurrency through a combination of lightweight,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tasks aren't really memory isolated. Safe shared memory and zero-copy message passing (implying a shared heap) are nice things.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's hard to talk about these things, because we do, but they're safe. Any ideas on what exact wording to use?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This leading sentence may also be a little misleading, I would perhaps re-word it to something like:

Rust provides safe concurrent abstractions through a number of core library primitives.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Notably it may be good to avoid terms like "lightweight" as that tends to invoke the idea of green threading too much (split stacks, etc) which doesn't quite apply to our current task model.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like that, fixed.

@steveklabnik steveklabnik force-pushed the lets_not_lie_in_the_concurrency_guide branch from a9f1e8f to bd97565 Compare August 26, 2014 19:49
@steveklabnik
Copy link
Member Author

All great suggestions. Fixed!

reference to the underlying vector as if it were local.
and a clone is captured for each task via a procedure. This only copies
the wrapper and not it's contents. Within the task's procedure, the captured
Arc reference can be used as an immutable reference to the underlying vector as
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't the term "shared reference" now? (Instead of immutable)

@steveklabnik steveklabnik force-pushed the lets_not_lie_in_the_concurrency_guide branch from bd97565 to f9517ee Compare August 27, 2014 20:40
This cleans up blatant lies in the concurrency guide, and modernizes it
a bit. There's a lot more to do, but until I get to it, let's make it a
little bit better.
@steveklabnik steveklabnik force-pushed the lets_not_lie_in_the_concurrency_guide branch from f9517ee to 263d65c Compare August 27, 2014 20:42
@steveklabnik
Copy link
Member Author

@alexcrichton fixed the error, my bad. Since I just edited prose, I didn't expect it to fail.

bors added a commit that referenced this pull request Aug 27, 2014
…ncy_guide, r=alexcrichton

This cleans up blatant lies in the concurrency guide, and modernizes it
a bit. There's a lot more to do, but until I get to it, let's make it a
little bit better.
@bors bors closed this Aug 27, 2014
@bors bors merged commit 263d65c into rust-lang:master Aug 27, 2014
matthiaskrgr pushed a commit to matthiaskrgr/rust that referenced this pull request Mar 10, 2024
fix: Put style lints behind disabled-by-default config

Fixes rust-lang/rust-analyzer#16542
Fixes rust-lang/rust-analyzer#16725
cc rust-lang/rust-analyzer#16628

Our diagnostic infra is not yet setup for those kinds of diagnostics
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

Successfully merging this pull request may close these issues.

6 participants