• TehPers ( TehPers@beehaw.org ) 
    link
    fedilink
    English
    arrow-up
    3
    ·
    4 hours 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.

    • 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.