Post #1048793
2026-04-03 15:04 UTC
People often prefer to use interior mutability in Rust over exterior one. While this makes things in general easier to deal with, part of the reason they're easier is because they typically involve locks (mutex) and atomics. However, this also makes them less reliable because locks can deadlock. There is also a performance hit from them, which can in many cases be significant enough to care about.
A great way to think of exterior mutability and lifetimes in Rust, is as compile-time locks, ensuring you don't every have any possibility of deadlocks and they're completely free at runtime.
Replies (0)
No replies.