Abstract
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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
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)
Bershad, B.N.: Practical considerations for non-blocking concurrent objects. In: Proceedings 13th IEEE International Conference on Distributed Computing Systems, pp. 264–273 (1993)
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)
Fich, F., Herlihy, M., Shavit, N.: On the space complexity of randomized synchronization. Journal of the ACM 45(5), 843–862 (1998)
Fischer, M., Lynch, N., Paterson, M.: Impossibility of distributed consensus with one faulty process. Journal of the ACM, 374–382 (1985)
Harris, T.L.: A pragmatic implementation of non-blocking linked lists. In: Proceedings of the 15th International Symposium on Distributed Computing (2001)
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)
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)
Herlihy, M.: Wait-free synchronization. ACM Transactions on Programming Languages and Systems 13(1), 124–149 (1991)
Herlihy, M., Luchangco, V., Moir, M.: Obstruction-free software NCAS and transactional memory (2002) (unpublished manuscript)
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 authors
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)
Herlihy, M., Luchangco, V., Moir, M.: Space- and time-adaptive nonblocking algorithms. In: Proceedings of Computing: The Australasian Theory Symposium, CATS (2003)
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)
Herlihy, M., Wing, J.: Linearizability: A correctness condition for concurrent objects. ACM Transactions on Programming Languages and Systems 12(3), 463–492 (1990)
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)
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)
Lamport, L.: How to make a multiprocessor computer that correctly executes multiprocessor programs. IEEE Transactions on Computers C-28(9), 690–691 (1979)
Lamport, L.: A fast mutual exclusion algorithm. ACM Transactions on Computer Systems 5(1), 1–11 (1987)
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)
Luchangco, V., Moir, M., Shavit, N.: On the uncontended complexity of consensus (2002) (in preparation)
Lynch, N., Vaandrager, F.: Forward and backward simulations - part I: Untimed systems. Information and Computation 121(2), 214–233 (1995)
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)
Moir, M., Anderson, J.: Wait-free algorithms for fast, long-lived renaming. Science of Computer Programming 25, 1–39 (1995); A preliminary version appeared in Proceedings of the 8th International Workshop on Distributed Algorithms, pp. 141–155 (1994)
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)
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)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2003 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Luchangco, V., Moir, M., Shavit, N. (2003). On the Uncontended Complexity of Consensus. In: Fich, F.E. (eds) Distributed Computing. DISC 2003. Lecture Notes in Computer Science, vol 2848. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-39989-6_4
Download citation
DOI: https://doi.org/10.1007/978-3-540-39989-6_4
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-20184-7
Online ISBN: 978-3-540-39989-6
eBook Packages: Springer Book Archive