TY - CHAP

T1 - On the uncontended complexity of consensus

AU - Luchangco, Victor

AU - Moir, Mark

AU - Shavit, Nir

PY - 2003

Y1 - 2003

N2 - Lock-free algorithms are not required to guarantee a bound on the number of steps an operation takes under contention, so we cannot use the usual worst-case analysis to quantify them. A natural alternative is to consider the worst-case time complexity of operations executed in the more common uncontented case. Many state-of-the-art lock-free algorithms rely on compare-and-swap (CAS) or similar operations with high consensus number to allow effective interprocess coordination. Given the fundamental nature of consensus operations to interprocess coordination, and the fact that instructions such as CAS are usually significantly more costly than simple loads and stores, it seems natural to consider a complexity measure that counts the number of operations with higher consensus number. In this paper we show that, despite its natural appeal, such a measure is not useful. We do so by showing that one can devise a wait-free implementation of the universal compare-and-swap operation, with a "fast path" that requires only a constant number of loads and stores when the CAS is executed without contention, and uses a hardware CAS operation only if there is contention. Thus, at least in theory, any CAS-based algorithm can be transformed into one that does not invoke any CAS operations along its uncontended "fast path", so simply counting the number of such operations invoked in this case is meaningless.

AB - Lock-free algorithms are not required to guarantee a bound on the number of steps an operation takes under contention, so we cannot use the usual worst-case analysis to quantify them. A natural alternative is to consider the worst-case time complexity of operations executed in the more common uncontented case. Many state-of-the-art lock-free algorithms rely on compare-and-swap (CAS) or similar operations with high consensus number to allow effective interprocess coordination. Given the fundamental nature of consensus operations to interprocess coordination, and the fact that instructions such as CAS are usually significantly more costly than simple loads and stores, it seems natural to consider a complexity measure that counts the number of operations with higher consensus number. In this paper we show that, despite its natural appeal, such a measure is not useful. We do so by showing that one can devise a wait-free implementation of the universal compare-and-swap operation, with a "fast path" that requires only a constant number of loads and stores when the CAS is executed without contention, and uses a hardware CAS operation only if there is contention. Thus, at least in theory, any CAS-based algorithm can be transformed into one that does not invoke any CAS operations along its uncontended "fast path", so simply counting the number of such operations invoked in this case is meaningless.

UR - http://www.scopus.com/inward/record.url?scp=35248875793&partnerID=8YFLogxK

U2 - 10.1007/978-3-540-39989-6_4

DO - 10.1007/978-3-540-39989-6_4

M3 - ???researchoutput.researchoutputtypes.contributiontobookanthology.chapter???

AN - SCOPUS:35248875793

SN - 354020184X

SN - 9783540201847

T3 - Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics)

SP - 45

EP - 59

BT - Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics)

A2 - Fich, Faith Ellen

PB - Springer Verlag

ER -