In defense of lock poisoning in Rust
sunshowers.io·5d·
Discuss: Lobsters
🦀Rust Verification
Preview
Report Post

There’s recently been some discussion about the benefits and downsides of lock (mutex) poisoning in Rust, spurred by a recent proposal to make the default mutex non-poisoned, i.e. silently unlock on panic (see also, recent discussion on Hacker News). As a passionate defender of lock poisoning, I thought I’d gather and write about my thoughts on this matter.

To summarize, I believe:

  • Unexpected cancellations in critical sections cause real harm to system correctness.
  • Lock poisoning is an important part of ensuring the correctness of critical sections in Rust.
  • Poisoning applies more generally than mutexes, and providing an easy way to track that (via e.g. a Poison<T>

Similar Posts

Loading similar posts...