Jon Gjengset explains the Send and Sync marker traits in Rust, exploring how they ensure thread safety and how they are implemented.
This time we go over the Send and Sync marker traits from the standard library, as well as some of the most important implementors (and non-implementors) of them. You can find the nomicon entry for Send/Sync here: doc.rust-lang.org/nomicon/send-and-sync.html.
Live version with chat: youtu.be/xmkSDM5omFA
Why Send and Sync?
What are Send and Sync?
Marker traits
Auto traits
The Send trait
Types that aren't Send
Digging into Rc
The Sync trait
Send + !Sync
Negative implementations
Sending mutable references
Raw pointers
std::sync::mpsc and !Sync
Placement of T: Send/Sync bounds
Per-OS impl Send for guards
more std::sync::mpsc and !Sync
Is Send/Sync auto-implemented?
The nomicon Send/Sync entry
There's no magic!
Negative impls on stable
Why it's here
2 people recommend this
What people say. Highly recommended as an excellent, deep-dive explanation of Rust's Send and Sync traits and thread safety.
r
u/realflakmin r/rust • Recommends
On “The docs say HashMap is Send + Sync-- how can that be?”
Maybe you will like video form of the answer? John Gjengset has recently published crust of rust episode concerning this topic link to this video needles to say it's awesome 😎