News for hackers. Stuff that matters.
Re:Inside Rust's std and parking_lot mutexes – who wins? by zozbot234 on Tuesday November 25, 2025 @05:11AM (#46044333)
A panic in single-threaded, non-parallel code will either terminate the program or be recovered cleanly, so the potential for side effects to be silently observed in a way that breaks invariants is unique to Mutex<>. This is the reason for mutex poisoning,
Re:Inside Rust's std and parking_lot mutexes – who wins? by simonask on Tuesday November 25, 2025 @09:29AM (#46046054)
I fail to see that there is any material difference. Whether you catch-unwind within a single thread or in a separate thread such that the panic can be resumed on join makes zero difference.

Heck, you can have Drop impls observing the state while unwinding.

A true panic-safe data structure requires serious thought, and mutex poisoning does nothing here - it is neither necessary nor sufficient.

Re:Inside Rust's std and parking_lot mutexes – who wins? by JoshTriplett on Tuesday November 25, 2025 @05:29PM (#46051602)
This is exactly the problem. Poison is enough to be painful but not enough to fully solve the problem.

> Heck, you can have Drop impls observing the state while unwinding.

Yeah, this is really painful and regularly forgotten. And one reason it'd be nice to not have unwinding.

Re:Inside Rust's std and parking_lot mutexes – who wins? by dap on Tuesday November 25, 2025 @11:14PM (#46054135)
This is a false dichotomy. Not every technique needs to work in all cases in order to be useful.

This seems analogous to arguing that because seat belts don't save the lives of all people involved in car crashes, and they're kind of annoying, then they shouldn't be factory-standard.

Re:Inside Rust's std and parking_lot mutexes – who wins? by simonask on Wednesday November 26, 2025 @02:34AM (#46055051)
This is a case of a feature that is actively harmful for the things it tries to prevent, because it increases the risk in practice of panics "spreading" throughout a system, even after the programmer thought she had finished handling it, and because it gives a false impression what kind of guarantee you actually have.