Abstract
We present an N-process local-spin mutual exclusion algorithm, based on nonatomic reads and writes, in which each process performs Θ(log N) remote memory references to enter and exit its critical section. This algorithm is derived from Yang and Anderson's atomic tree-based local-spin algorithm in a way that preserves its time complexity. No atomic read/write algorithm with better asymptotic worst-case time complexity (under the remote-mem-ory-refer-ences measure) is currently known. This suggests that atomic memory is not fundamentally required if one is interested in worst-case time complexity.
The same cannot be said if one is interested in fast-path algorithms (in which contention-free time complexity is required to be O(1)) or adaptive algorithms (in which time complexity is required to depend only on the number of contending processes). We show that such algorithms fundamentally require memory accesses to be atomic. In particular, we show that for any N-process nonatomic algorithm, there exists a single-process execution in which the lone competing process accesses Ω(log N/log log N) distinct variables to enter its critical section. Thus, fast and adaptive algorithms are impossible even if caching techniques are used to avoid accessing the processors-to-memory interconnection network.
Similar content being viewed by others
References
Afek, Y., Attiya, H., Fouren, A., Stupp, G., Touitou, D.: Long-lived renaming made adaptive. In: Proceedings of the 18th Annual ACM Symposium on Principles of Distributed Computing, pp. 91–103. ACM (1999)
Afek, Y., Boxer, P., Touitou, D.: Bounds on the shared memory requirements for long-lived and adaptive objects. In: Proceedings of the 19th Annual ACM Symposium on Principles of Distributed Computing, pp. 81–89. ACM (2000)
Afek, Y., Stupp, G., Touitou, D.: Long-lived adaptive collect with applications. In: Proceedings of the 40th Annual Symposium on Foundations of Computer Science, pp. 262–272. IEEE (1999)
Afek, Y., Stupp, G., Touitou, D.: Long-lived adaptive splitter and applications. Distributed Comput. 15(2), 67–86 (2002)
Alur, R., Taubenfeld, G.: Contention-free complexity of shared memory algorithms. Inf. Comput. 126(1),62–73 (1996)
Anderson, J.: A fine-grained solution to the mutual exclusion problem. Acta Informatica 30(3), 249–265 (1993)
Anderson, J., Gouda, M.: Atomic semantics of nonatomic programs. Inf. Process. Lett. 28(2), 99–103 (1988)
Anderson, J., Kim, Y.J.: Adaptive mutual exclusion with local spinning. In: Proceedings of the 14th International Symposium on Distributed Computing, pp. 29–43. Lecture Notes in Computer Science 1914, Springer-Verlag (2000)
Anderson, J., Kim, Y.J.: A new fast-path mechanism for mutual exclusion. Distributed Comput. 14(1), 17–29 (2001)
Anderson, J., Kim, Y.J.: Nonatomic mutual exclusion with local spinning. In: Proceedings of the 21st Annual ACM Symposium on Principles of Distributed Computing, pp. 3–12. ACM (2002)
Anderson, J., Kim, Y.J.: An improved lower bound for the time complexity of mutual exclusion. Distributed Comput. 15(4), 221–253 (2003)
Anderson, J., Yang, J.H.: Time/contention tradeoffs for multiprocessor synchronization. Inf. Comput. 124(1), 68–84 (1996)
Anderson, T.: The performance of spin lock alternatives for shared-memory multiprocessors. IEEE Trans. Parallel and Distributed Syst. 1(1), 6–16 (1990)
Attiya, H., Bortnikov, V.: Adaptive and efficient mutual exclusion. In: Proceedings of the 19th Annual ACM Symposium on Principles of Distributed Computing, pp. 91–100. ACM (2000)
Burns, J., Lynch, N.: Mutual exclusion using indivisible reads and writes. In: Proceedings of the 18th Annual Allerton Conference on Communication, Control, and Computing, pp. 833–842 (1980)
Choy, M., Singh, A.: Adaptive solutions to the mutual exclusion problem. Distributed Comput. 8(1), 1–17 (1994)
Graunke, G., Thakkar, S.: Synchronization algorithms for shared-memory multiprocessors. IEEE Comput. 23, 60–69 (1990)
Haldar, S., Subramanian, P.: Space-optimum conflict-free construction of 1-writer 1-reader multivalued atomic variable. In: Proceedings of the Eighth International Workshop on Distributed Algorithms, pp. 116–129. Lecture Notes in Computer Science 857, Springer-Verlag (1994)
Haldar, S., Vidyasankar, K.: Constructing 1-writer multireader multivalued atomic variables from regular variables. J. ACM 42(1), 186–203 (1995)
Kessels, J.: Arbitration without common modifiable variables. Acta Informatica 17, 135–141 (1982)
Kim, Y.J., Anderson, J.: A time complexity bound for adaptive mutual exclusion. In: Proceedings of the 15th International Symposium on Distributed Computing, pp. 1–15. Lecture Notes in Computer Science 2180, Springer-Verlag (2001)
Lamport, L.: A new solution of Dijkstra's concurrent programming problem. Commun. ACM 17(8), 453–455 (1974)
Lamport, L.: The mutual exclusion problem: {Part II–-Statement} and solutions. J. ACM 33(2), 327–348 (1986)
Lamport, L.: On interprocess communication: Part II–-Algorithms. Distributed Comput. 1, 86–101 (1986)
Lamport, L.: A fast mutual exclusion algorithm. ACM Trans. Comput. Syst. 5(1), 1–11 (1987)
Lamport, L.: win and sin: Predicate transformers for concurrency. ACM Trans. Programming Languages and Syst. 12(3), 396–428 (1990)
Mellor-Crummey, J., Scott, M.: Algorithms for scalable synchronization on shared-memory multiprocessors. ACM Trans. Comput. Syst. 9(1), 21–65 (1991)
Peterson, G., Burns, J.: Concurrent reading while writing {II}: The multi-writer case. In: Proceedings of the 28th Annual ACM Symposium on the Foundation of Computer Science. ACM (1987)
Schaffer, R.: On the correctness of atomic multi-writer registers. Tech. Rep. MIT/LCS/TM-364, Laboratory for Computer Science, MIT, Cambridge (1988)
Singh, A., Anderson, J., Gouda, M.: The elusive atomic register. J. ACM 41(2), 311–339 (1994)
Styer, E.: Improving fast mutual exclusion. In: Proceedings of the 11th Annual ACM Symposium on Principles of Distributed Computing, pp. 159–168. ACM (1992)
Styer, E., Peterson, G.: Tight bounds for shared memory symmetric mutual exclusion. In: Proceedings of the 8th Annual ACM Symposium on Principles of Distributed Computing, pp. 177–191. ACM (1989)
Turán, P.: On an extremal problem in graph theory (in Hungarian). Mat. Fiz. Lapok 48, 436–452 (1941)
Yang, J.H., Anderson, J.: A fast, scalable mutual exclusion algorithm. Distributed Comput. 9(1), 51–60 (1995)
Author information
Authors and Affiliations
Corresponding author
Additional information
This paper was invited for inclusion in the special issue of this journal based on selected papers presented in PODC '02 (Distributed Computing 18(1)).It appears separately because of a publication delay.
Yong-Jik Kimreceived a B.S. degree in Physics/Computer Science from Korea Advanced Institute of Science and Technology in 1998, and a Ph.D.degree in Computer Science from the University of Notrh Carolina at Chapel Hill in 2003. He currently works for the RDBMS group in Tmax Soft, and is otherwise occupied with his newborn daughter Darum, which means “difference” in Korean.
James H. Anderson is a professor in the Department of Computer Science at the University of North Carolina at Chapel Hill. He received a B.S.degree in Computer Science from Michigan State University in 1982, an M.S. degree in Computer Science from Purdue University in 1983, and a Ph.D. degree in Computer Sciences from the University of Texas at Austin in 1990. Before joining UNC-Chapel Hill in 1993, he was with the Computer Science Department at the University of Maryland between 1990 and 1993. Dr.Anderson's main research interests are within the areas of real-time systems and concurrent and distributed computing.
Rights and permissions
About this article
Cite this article
Kim, YJ., Aderson, J.H. Nonatomic mutual exclusion with local spinning. Distrib. Comput. 19, 19–61 (2006). https://doi.org/10.1007/s00446-006-0003-z
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s00446-006-0003-z