#concurrency
in blog posts
Rc vs Arc in Rust: Memory Layout, Send/Sync Bounds, and Atomic Orderings
std::rc::Rc<T> and std::sync::Arc<T> both give a heap-allocated T multiple owners via reference counting, and both hand out only shared references (&T) on dereference. Summarizing them as “Rc for single-threaded code, Arc for multithreaded code” is a useful starting rule, but it skips four details that matter in real Rust code: how the heap allocation is laid out, when Arc<T> actually implements Send and Sync, what atomic memory orderings Arc pays for, and how mutation and reference cycles behave.