36
you are viewing a single comment's thread
view the rest of the comments
[-] JATothrim_v2@programming.dev 2 points 1 day ago

This post annoyed me enough to answer. A robust mutex: a futex shared by processes. If a process crashes while holding a robust mutex, it's possible to recover from such a situation.

The rust people are basically trying to reinvent a robust mutex. If your thread crashes, it should bring down the entire process, pronto. If it should not, use a process.

Why are they not just storing a extra bit in the futex word, is beoynd me.

[-] TehPers@beehaw.org 2 points 1 day ago

If your thread crashes, it should bring down the entire process, pronto. If it should not, use a process.

This highly depends on the environment. Rust is used in a lot of places where you don't have the option to spawn multiple processes. Even in environments where spawning is an option, it's not often desirable to take down the whole service when one panic occurs.

It also has nothing to do with mutex poisoning. In fact, if this were the case, you would not need poisoning at all because the process could terminate before the lock is released.

[-] JATothrim_v2@programming.dev 1 points 1 day ago

I do know that in embedded programming you have very little head room.

In fact, if this were the case, you would not need poisoning at all because the process could terminate before the lock is released.

That's precisely when you need a robust mutex. The process that held the mutex is now dead. Trying to lock the mutex gives you the bit that the state supposedly protected by the mutex is now invalid.

[-] SorteKanin@feddit.dk 1 points 1 day ago

If a process crashes while holding a robust mutex, it’s possible to recover from such a situation.

But that's the whole point of poisoning too. If a different thread crashed and the mutex is poisoned, you can recover in a different thread. Most applications choose not to recover and chooses to just panic again, but you can choose to recover.

this post was submitted on 18 Nov 2026
36 points (100.0% liked)

Rust

8379 readers
30 users here now

Welcome to the Rust community! This is a place to discuss about the Rust programming language.

Wormhole

!performance@programming.dev

Credits

  • The icon is a modified version of the official rust logo (changing the colors to a gradient and black background)

founded 3 years ago
MODERATORS