Mutex poisoning is not for everyone

32 points by polywolf


natkr

Couldn't disagree harder with this post. It basically makes two claims:

  1. Poisoning costs performance, both for bookkeeping and panic propagation
  2. Uptime is more important than correctness

For 1, yeah, but that's consistent with the rest of the standard library. HashMap defaults to SipHash even though it's slower than something like AHash.. because they consider collision unpredictability to be more important than best-case performance. If your use case is hot enough for this to be a problem and it actually is safe under panicking and you've put in the work to prove that.. you can still use parking_lot! It's good that the option is there.. but it's also good it's easier to use the seatbelt than to turn off the warning.

For 2.. no? We don't do On Error Resume Next all over the place anymore either. I'm sure there are cases where it might make sense, but if silencing the error in those cases is the hard part... I have to doubt that you're actually bothering with the hard part.

aster

I realize that rust is no longer a young language where change can rapidly happen, but it's a shame that people are so afraid to introduce edition breaking changes, this is what editions are for. The issues with poisoning mutexes are well documented, and I think it would be a shame to keep it as the default going forwards.