Curriculum/send-sync-traits
Send & Sync Traits
synchronization·L1 · combinator·stub
Replacesthe belief that thread safety is a runtime property.
Rust encodes thread safety in two marker traits. `Send`: ownership can transfer across thread boundaries. `Sync`: shared references (`&T`) can cross thread boundaries. `Mutex<T>` is `Sync` if T is `Send`. `Rc<T>` is neither (non-atomic refcount). `Cell<T>` is `Send` but not `Sync` (interior mutability is single-thread-only). `thread::spawn`'s closure must be `Send + 'static` — the compiler enforces the property before the program runs.
Prerequisites
Bridges
- thread-safety-marker-traitsshared mechanismMarker traits with no methods, used purely as type-level constraints, are a Rust idiom inherited from Haskell's typeclass-as-marker pattern. C++ achieves similar discipline via concepts (C++20) but at much later maturity.
This concept is a node in the curriculum DAG. The full lab — page blocks, done state, references — has not been authored yet. The relations above describe where it sits in the graph.
Author at: content/concepts/send-sync-traits/card.ts