Rust theorytheory 0/50 · 0%
Concurrency · medium

32. Mutex, RwLock and Arc

Sharing mutable state safely.

`Arc<T>` shares ownership atomically across threads. `Mutex<T>` grants exclusive access via a guard released on drop; `RwLock<T>` allows many readers or one writer. Lock poisoning surfaces a panic that occurred while a lock was held.

Check your understanding

  1. 1. Which pairs with Mutex across threads?

  2. 2. A Mutex guard unlocks when…