On the Uncontended Complexity of Consensus
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 uncontended 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.
KeywordsCurrent Block Consensus Algorithm Linearization Point Fast Path Software Transactional Memory
Unable to display preview. Download preview PDF.
- 1.Arora, N.S., Blumofe, R.D., Plaxton, C.G.: Thread scheduling for multipro-grammed multiprocessors. In: Proceedings of the 10th Annual ACM Symposium on Parallel Algorithms and Architectures, pp. 119–129 (1998)Google Scholar
- 2.Bershad, B.N.: Practical considerations for non-blocking concurrent objects. In: Proceedings 13th IEEE International Conference on Distributed Computing Systems, pp. 264–273 (1993)Google Scholar
- 3.Buhrman, H., Garay, J., Hoepman, J., Moir, M.: Long-lived renaming made fast. In: Proceedings of the 14th Annual ACM Symposium on Principles of Distributed Computing, pp. 194–203 (1995)Google Scholar
- 5.Fischer, M., Lynch, N., Paterson, M.: Impossibility of distributed consensus with one faulty process. Journal of the ACM, 374–382 (1985)Google Scholar
- 6.Harris, T.L.: A pragmatic implementation of non-blocking linked lists. In: Proceedings of the 15th International Symposium on Distributed Computing (2001)Google Scholar
- 7.Harris, T.L., Fraser, K., Pratt, I.A.: A practical multi-word compare-and-swap operation. In: Proceedings of 16th International Symposium on DIStributed Computing (2002)Google Scholar
- 8.Hendler, D., Shavit, N.: Non-blocking steal-half work queues. In: Proceedings of the 21st Annual ACM Symposium on Principles of Distributed Computing, pp. 280–289 (2002)Google Scholar
- 10.Herlihy, M., Luchangco, V., Moir, M.: Obstruction-free software NCAS and transactional memory (2002) (unpublished manuscript)Google Scholar
- 11.Herlihy, M., Luchangco, V., Moir, M.: The repeat offender problem: A mechanism for supporting lock-free dynamic-sized data structures. In: Proceedings of the 16th International Symposium on DIStributed Computing (2002); A improved version of this paper is in preparation for journal submission; please contact authorsGoogle Scholar
- 12.Herlihy, M., Luchangco, V., Moir, M.: Obstruction-free synchronization: Double-ended queues as an example. In: Proceedings of the 23rd International Conference on Distributed Computing Systems (2003)Google Scholar
- 13.Herlihy, M., Luchangco, V., Moir, M.: Space- and time-adaptive nonblocking algorithms. In: Proceedings of Computing: The Australasian Theory Symposium, CATS (2003)Google Scholar
- 14.Herlihy, M., Luchangco, V., Moir, M., Scherer III., W.N.: Software transactional memory of dynamic-sized data structures. In: Proceedings of the 22nd Annual ACM Symposium on Principles of Distributed Computing (2003)Google Scholar
- 16.Kawachiya, K., Koseki, A., Onodera, T.: Lock reservation: Java locks can mostly do without atomic operations. In: Proceedings of the ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), pp. 130–141 (2002)Google Scholar
- 17.LaMarca, A.: A performance evaluation of lock-free synchronization protocols. In: Proceedings of the 13th Annual ACM Symposium on Principles of Distributed Computing, Los Angeles, CA, pp. 130–140 (1994)Google Scholar
- 20.Loui, M.C., Abu-Amara, H.H.: Memory requirements for agreement among unreliable asynchronous processes. In: Preparata, F.P. (ed.) Advances in Computing Research, vol. 4, pp. 163–183. JAI Press, Greenwich (1987)Google Scholar
- 21.Luchangco, V., Moir, M., Shavit, N.: On the uncontended complexity of consensus (2002) (in preparation)Google Scholar
- 23.Michael, M.M.: High performance dynamic lock-free hash tables and list-based sets. In: Proceedings of the 14th Annual ACM Symposium on Parallel Algorithms and Architectures, pp. 73–82 (2002)Google Scholar
- 25.Saks, M., Shavit, N., Woll, H.: Optimal time randomized consensus — making resilient algorithms fast in practice. In: Proceedings of the Second Annual ACM-SIAM Symposium on Discrete algorithms, pp. 351–362 (1991)Google Scholar
- 26.Shalev, O., Shavit, N.: Split-ordered lists — lock-free resizable hash tables. In: Proceedings of the 22nd Annual ACM Symposium on Principles of Distributed Computing (2003)Google Scholar