4 ms·
While the mutex is held, everybody else that is in contention is waiting, possibly forever. It's a terrible paradigm not suitable for any serious systems progr
by mgaunard 4y ago
While the mutex is held, everybody else that is in contention is waiting, possibly forever.
It's a terrible paradigm not suitable for any serious systems programming, especially if you have any sort of real-time requirements.
- preseinger 4y agomutexes are a primitive that guarantee access to a resource is synchronized, and only one actor is accessing it at a time this necessarily requires actors in contention to wait, possibly forever it is a fundamental paradigm that is used extensively throughout every kind of programming, even in real-time systems
- mgaunard 4y agoIt isn't used in real-time systems no, it's fundamentally incompatible. Check out wait-free algorithms.
- preseinger 4y agosynchronization requires serialized access, regardless of the nature of the consumer system (real-time or not) wait-free algorithms might use spin-locks instead of typical mutexes, but spin-locks aren't like better or faster than mutexes, they just replace syscall/io waits with hot waits