-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Fix lies in the concurrency guide. #16757
Conversation
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, |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like that, fixed.
a9f1e8f
to
bd97565
Compare
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 |
There was a problem hiding this comment.
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)
bd97565
to
f9517ee
Compare
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.
f9517ee
to
263d65c
Compare
@alexcrichton fixed the error, my bad. Since I just edited prose, I didn't expect it to fail. |
…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.
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
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.