Re:Measuring mutexes, spinlocks and how bad the Linux schedu...
by imtringued on Wednesday January 01, 2020 @07:47AM
(#21927821)
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.
[ Parent
| on HN ]
Re:Measuring mutexes, spinlocks and how bad the Linux schedu...
by tsimionescu on Thursday January 02, 2020 @05:55AM
(#21934390)
The 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.