4 ms·
In my experience it is very to easy get into situations where using only mutexes is impossible. As soon as you need a lock per object and access two objects the
by imtringued 7y ago
In my experience it is very to easy get into situations where using only mutexes is impossible. As soon as you need a lock per object and access two objects then you have to make sure to only acquire one lock at a time. The end result is that you are effectively using the stack as a message queue that can only hold one element.
- tsimionescu 7y agoThe solution with multiple locks is to always take them in the same defined order on any code path - that guarantees that you can't get into deadlock situations.