Shared Mutable State in Rust with Arc<Mutex<T>>: A Practical Guide
Arc<Mutex<T>> is Rust's idiomatic answer to shared mutable state across threads. Here's how the guard-and-poisoning mechanics work, a runnable counter example, and when atomics, RwLock, or channels are the better call.