Progress guarantees
So, there is no clear winner performance-wise. The really big advantage of lock-free data structures is, however, a different one, namely the progress guarantees. Because every thread is in control of its own spinning, if we are clever, we can always avoid deadlocks and prevent priority inversions.
There are several levels of progress guarantees, which are sometimes also used as synonyms for the colloquially named lock-free algorithms: non-blocking (or obstruction-free) if the failure or suspension of any thread cannot cause the failure or suspension of another thread, wait-free if every operation in a program is guaranteed to complete in a finite number of steps, and lock-free if this guarantee also applies to single ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access