Conceptual
Login

Send and Sync Traits

Send means a type can be moved to another thread; Sync means &T can be shared across threads (T is Sync iff &T is Send). Both are auto traits derived structurally, which is why Rc is neither while Arc<Mutex<T>> is both, and why data races become compile errors.

This Concept is waiting for its first lesson!

Send means a type can be moved to another thread; Sync means &T can be shared across threads (T is Sync iff &T is Send). Both are auto traits derived structurally, which is why Rc is neither while Arc<Mutex<T>> is both, and why data races become compile errors.

Are you a teacher? Sign in to start contributing.

Sign In