Skip to main content
Log in

Nonatomic mutual exclusion with local spinning

  • Original Article
  • Published:
Distributed Computing Aims and scope Submit manuscript

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.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  1. 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)

  2. 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)

  3. 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)

  4. Afek, Y., Stupp, G., Touitou, D.: Long-lived adaptive splitter and applications. Distributed Comput. 15(2), 67–86 (2002)

    Article  Google Scholar 

  5. Alur, R., Taubenfeld, G.: Contention-free complexity of shared memory algorithms. Inf. Comput. 126(1),62–73 (1996)

    Article  MATH  MathSciNet  Google Scholar 

  6. Anderson, J.: A fine-grained solution to the mutual exclusion problem. Acta Informatica 30(3), 249–265 (1993)

    Article  MATH  MathSciNet  Google Scholar 

  7. Anderson, J., Gouda, M.: Atomic semantics of nonatomic programs. Inf. Process. Lett. 28(2), 99–103 (1988)

    Article  MATH  MathSciNet  Google Scholar 

  8. 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)

  9. Anderson, J., Kim, Y.J.: A new fast-path mechanism for mutual exclusion. Distributed Comput. 14(1), 17–29 (2001)

    Article  MATH  Google Scholar 

  10. 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)

  11. Anderson, J., Kim, Y.J.: An improved lower bound for the time complexity of mutual exclusion. Distributed Comput. 15(4), 221–253 (2003)

    Article  Google Scholar 

  12. Anderson, J., Yang, J.H.: Time/contention tradeoffs for multiprocessor synchronization. Inf. Comput. 124(1), 68–84 (1996)

    Article  MATH  MathSciNet  Google Scholar 

  13. Anderson, T.: The performance of spin lock alternatives for shared-memory multiprocessors. IEEE Trans. Parallel and Distributed Syst. 1(1), 6–16 (1990)

    Article  Google Scholar 

  14. 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)

  15. 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)

  16. Choy, M., Singh, A.: Adaptive solutions to the mutual exclusion problem. Distributed Comput. 8(1), 1–17 (1994)

    Article  Google Scholar 

  17. Graunke, G., Thakkar, S.: Synchronization algorithms for shared-memory multiprocessors. IEEE Comput. 23, 60–69 (1990)

    Google Scholar 

  18. 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)

  19. Haldar, S., Vidyasankar, K.: Constructing 1-writer multireader multivalued atomic variables from regular variables. J. ACM 42(1), 186–203 (1995)

    Article  MATH  Google Scholar 

  20. Kessels, J.: Arbitration without common modifiable variables. Acta Informatica 17, 135–141 (1982)

    Article  MATH  MathSciNet  Google Scholar 

  21. 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)

  22. Lamport, L.: A new solution of Dijkstra's concurrent programming problem. Commun. ACM 17(8), 453–455 (1974)

    Article  MATH  MathSciNet  Google Scholar 

  23. Lamport, L.: The mutual exclusion problem: {Part II–-Statement} and solutions. J. ACM 33(2), 327–348 (1986)

    Article  MATH  MathSciNet  Google Scholar 

  24. Lamport, L.: On interprocess communication: Part II–-Algorithms. Distributed Comput. 1, 86–101 (1986)

    Article  MATH  Google Scholar 

  25. Lamport, L.: A fast mutual exclusion algorithm. ACM Trans. Comput. Syst. 5(1), 1–11 (1987)

    Article  Google Scholar 

  26. Lamport, L.: win and sin: Predicate transformers for concurrency. ACM Trans. Programming Languages and Syst. 12(3), 396–428 (1990)

    Article  Google Scholar 

  27. Mellor-Crummey, J., Scott, M.: Algorithms for scalable synchronization on shared-memory multiprocessors. ACM Trans. Comput. Syst. 9(1), 21–65 (1991)

    Article  Google Scholar 

  28. 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)

  29. Schaffer, R.: On the correctness of atomic multi-writer registers. Tech. Rep. MIT/LCS/TM-364, Laboratory for Computer Science, MIT, Cambridge (1988)

  30. Singh, A., Anderson, J., Gouda, M.: The elusive atomic register. J. ACM 41(2), 311–339 (1994)

    Article  MATH  Google Scholar 

  31. Styer, E.: Improving fast mutual exclusion. In: Proceedings of the 11th Annual ACM Symposium on Principles of Distributed Computing, pp. 159–168. ACM (1992)

  32. 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)

  33. Turán, P.: On an extremal problem in graph theory (in Hungarian). Mat. Fiz. Lapok 48, 436–452 (1941)

    MATH  MathSciNet  Google Scholar 

  34. Yang, J.H., Anderson, J.: A fast, scalable mutual exclusion algorithm. Distributed Comput. 9(1), 51–60 (1995)

    Article  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to J. H. Aderson.

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

Reprints 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

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s00446-006-0003-z

Navigation