-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Examples for Sync/Send leave too many open questions #1640
Comments
Hi @proski!
Yeah, this slide is tough... I normally have to add a lot of context around it when teaching. So we should start by adding the missing information to the notes at the bottom of the page. If you like, you could send us a PR with any information you've found useful yourself. |
I would say that in this context "thread-safe" is trying to convey that these are types whose values can be safely accessed from multiple threads concurrently. This means, of course, having a reference to them in multiple threads, AKA It would be good to clarify this in the slide content itself. |
Problematic page:
https://google.github.io/comprehensive-rust/concurrency/send-sync/examples.html
Example of inaccuracy:
Arc<T>
is in theSend + Sync
section. However, a later page aboutArc
says that it's not true for all types:What is
T
anyway? Shouldn't trait bounds be included?Clarification needed:
Both
bool
andAtomicBool
are in theSend + Sync
section. What's the point in havingAtomicBool
?i8
andAtomicU8
are in theSend + Sync
section. No mention ofu8
orAtomicI8
(which exists). It might give a wrong impression thati8
andu8
have some differences w.r.t. synchronization.Possibly extraneous:
It feels like a zoo with exotic animals. I'd rather see an exact definition of "thread-safe".
The text was updated successfully, but these errors were encountered: