2 ms·
> there could be other issues, like mutex poisoning, which is why nobody uses the stdlib's mutexes. What does everyone use instead?
by EE84M3i 2y ago
> there could be other issues, like mutex poisoning, which is why nobody uses the stdlib's mutexes.
What does everyone use instead?
- tuetuopay 2y agoIn the context of Tokio, the tokio's native mutexes / locking primitives. For sync code, parking_lot is the de facto replacement for the stdlib's ones. I don't remember where I read it, but it has been admitted that having synchronization primitives with poisoning in the stdlib was a mistake, and "simpler" ones without it. for context: a mutex is poisoned should a panic occur while the mutex is held. it is then assumed the guarded data to be broken or in an unknown state, thus poisoned.
- selfmodruntime 2y agoparking_lot