Skip to main content

The Black-White Bakery Algorithm and Related Bounded-Space, Adaptive, Local-Spinning and FIFO Algorithms

  • Conference paper
Distributed Computing (DISC 2004)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 3274))

Included in the following conference series:

Abstract

A mutual exclusion algorithm is presented that has four desired properties: (1) it satisfies FIFO fairness, (2) it satisfies local-spinning, (3) it is adaptive, and (4) it uses finite number of bounded size atomic registers. No previously published algorithm satisfies all these properties. In fact, it is the first algorithm (using only atomic registers) which satisfies both FIFO and local-spinning, and it is the first bounded space algorithm which satisfies both FIFO and adaptivity.

All the algorithms presented are based on Lamport’s famous Bakery algorithm [27], which satisfies FIFO, but uses unbounded size registers (and does not satisfy local-spinning and is not adaptive). Using only one additional shared bit, we bound the amount of space required by the Bakery algorithm by coloring the tickets taken in the Bakery algorithm. The resulting Black-White Bakery algorithm preserves the simplicity and elegance of the original algorithm, satisfies FIFO and uses finite number of bounded size registers. Then, in a sequence of steps (which preserve simplicity and elegance) we modify the new algorithm so that it is also adaptive to point contention and satisfies local-spinning.

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

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Abraham, U.: Bakery algorithms. In: Proc. of the Concurrency, Specification and Programming Workshop, pp. 7–40 (1993)

    Google Scholar 

  2. Afek, Y., Dolev, D., Gafni, E., Merritt, M., Shavit, N.: A bounded first-in, firstenabled solution to the l-exclusion problem. ACM Transactions on Programming Languages and Systems 16(3), 939–953 (1994)

    Article  Google Scholar 

  3. Afek, Y., Stupp, G., Touitou, D.: Long-lived adaptive collect with applications. In: Proc. 40th IEEE Symp. on Foundations of Computer Science, pp. 262–272 (1999)

    Google Scholar 

  4. Afek, Y., Stupp, G., Touitou, D.: Long lived adaptive splitter and applications. Distributed Computing 30, 67–86 (2002)

    Google Scholar 

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

    Article  MATH  MathSciNet  Google Scholar 

  6. Anderson, J.H., Kim, Y.-J.: Adaptive mutual exclusion with local spinning. In: Herlihy, M.P. (ed.) DISC 2000. LNCS, vol. 1914, pp. 29–43. Springer, Heidelberg (2000)

    Chapter  Google Scholar 

  7. Anderson, J.H., Kim, Y.-J.: Nonatomic mutual exclusion with local spinning. In: Proc. 21st ACM Symp. on Principles of Distributed Computing, pp. 3–12 (2002)

    Google Scholar 

  8. Anderson, J., Kim, Y.-J., Herman, T.: Shared-memory mutual exclusion: Major research trends since 1986. Distributed Computing 16, 75–110 (2003)

    Article  Google Scholar 

  9. Anderson, T.E.: The performance of spin lock alternatives for shared-memory multiprocessor. IEEE Trans. on Parallel and Distributed Systems 1(1), 6–16 (1990)

    Article  Google Scholar 

  10. Attiya, H., Bortnikov, V.: Adaptive and efficient mutual exclusion. Distributed Computing 15(3), 177–189 (2002)

    Article  Google Scholar 

  11. Attiya, H., Fouren, A.: Algorithms adapting to point contention. Journal of the ACM 50(4), 144–468 (2003)

    Article  MathSciNet  Google Scholar 

  12. Burns, J.E., Lynch, A.N.: Mutual exclusion using indivisible reads and writes. In: 18th annual allerton conf. on comm., control and computing, pp. 833–842 (1980)

    Google Scholar 

  13. Burns, J.N., Lynch, N.A.: Bounds on shared-memory for mutual exclusion. Information and Computation 107(2), 171–184 (1993)

    Article  MATH  MathSciNet  Google Scholar 

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

    Article  Google Scholar 

  15. Dijkstra, E.W.: Solution of a problem in concurrent programming control. Communications of the ACM 8(9), 569 (1965)

    Article  Google Scholar 

  16. Dolev, D., Shavit, N.: Bounded concurrent time-stamping. SIAM Journal on Computing 26(2), 418–455 (1997)

    Article  MATH  MathSciNet  Google Scholar 

  17. Dwork, C., Waarts, O.: Simple and efficient bounded concurrent timestamping or bounded concurrent timestamp systems are comprehensible! In: Proc. 24rd ACM Symp. on Theory of Computing, May 1992, pp. 655–666 (1992)

    Google Scholar 

  18. Fischer, M.J., Lynch, N.A., Burns, J.E., Borodin, A.: Distributed FIFO allocation of identical resources using small shared space. ACM Trans. on Programming Languages and Systems 11(1), 90–114 (1989)

    Article  Google Scholar 

  19. Friedberg, S.A., Peterson, G.L.: An efficient solution to the mutual exclusion problem using weak semaphores. Info. Processing Letters 25(5), 343–347 (1987)

    Article  MATH  MathSciNet  Google Scholar 

  20. Gawlick, R., Lynch, N.A., Shavit, N.: Concurrent timestamping made simple. In: Israel Symposium on Theory of Computing Systems, pp. 171–183 (1992)

    Google Scholar 

  21. Graunke, G., Thakkar, S.: Synchronization algorithms for shared-memory multiprocessors. IEEE Computers 28(6), 69–69 (1990)

    Google Scholar 

  22. Israeli, A., Li, M.: Bounded time-stamps. Distributed Computing 6(4), 205–209 (1993)

    Article  MATH  Google Scholar 

  23. Inoue, M., Umetani, S., Masuzawa, T., Fujiwara, H.: Adaptive long-lived O(k 2)-renaming with O(k 2) steps. In: Welch, J.L. (ed.) DISC 2001. LNCS, vol. 2180, pp. 123–135. Springer, Heidelberg (2001)

    Chapter  Google Scholar 

  24. Jayanti, P.: Adaptive and efficient abortable mutual exclusion. In: Proc. 22nd ACM Symp. on Principles of Distributed Computing, July 2003, pp. 295–304 (2003)

    Google Scholar 

  25. Jayanti, P., Tan, K., Friedland, G., Katz, A.: Bounding Lamport’s Bakery algorithm. In: Pacholski, L., Ružička, P. (eds.) SOFSEM 2001. LNCS, vol. 2234, pp. 261–270. Springer, Heidelberg (2001)

    Chapter  Google Scholar 

  26. Katseff, H.P.: A new solution to the critical section problem. In: Proc. 10th ACM Symp. on Theory of Computing, May 1978, pp. 86–88 (1978)

    Google Scholar 

  27. Lamport, L.: A new solution of Dijkstra’s concurrent programming problem. Communications of the ACM 17(8), 453–455 (1974)

    Article  MATH  MathSciNet  Google Scholar 

  28. Lamport, L.: A bug in the Bakery algorithm. Technical Report CA–7704–0611, Massachusette computer associates, inc. (April 1977)

    Google Scholar 

  29. Lamport, L.: The mutual exclusion problem: Part II – statement and solutions. Journal of the ACM 33, 327–348 (1986)

    Article  MATH  MathSciNet  Google Scholar 

  30. Lycklama, E.A.: A first-come-first-served solution to the critical section problem using five bits. M.Sc. thesis, University of Toronto (October 1987)

    Google Scholar 

  31. Lycklama, E.A., Hadzilacos, V.: A first-come-first-served mutual exclusion algorithm with small communication variables. ACM Trans. on Programming Languages and Systems 13(4), 558–576 (1991)

    Article  Google Scholar 

  32. Lynch, N.A.: Distributed Algorithms. Morgan Kaufmann Publishers, Inc., San Francisco (1996)

    MATH  Google Scholar 

  33. Morris, J.M.: A starvation-free solution to the mutual exclusion problem. Information Processing Letters 8(2), 76–80 (1979)

    Article  MATH  Google Scholar 

  34. Mellor-Crummey, J.M., Scott, M.L.: Algorithms for scalable synchronization on shared-memory multiprocessors. ACM Trans. on Computer Systems 9(1), 21–65 (1991)

    Article  Google Scholar 

  35. Alur, R., Taubenfeld, G.: Results about fast mutual exclusion. In: Proceedings of the 13th IEEE Real-Time Systems Symposium, December 1992, pp. 12–21 (1992)

    Google Scholar 

  36. Merritt, M., Taubenfeld, G.: Speeding Lamport’s fast mutual exclusion algorithm. Information Processing Letters 45, 137–142 (1993) (Published as an AT&T technical memorandum, May 1991)

    Article  MATH  Google Scholar 

  37. Merritt, M., Taubenfeld, G.: Computing with infinitely many processes. In: Herlihy, M.P. (ed.) DISC 2000. LNCS, vol. 1914, pp. 164–178. Springer, Heidelberg (2000)

    Chapter  Google Scholar 

  38. Peterson, G.L., Fischer, M.J.: Economical solutions for the critical section problem in a distributed system. In: Proc. 9th ACM Symp. on Theory of Computing, pp. 91–97 (1977)

    Google Scholar 

  39. Raynal, M.: Algorithms for mutual exclusion. The MIT Press, Cambridge (1986)

    MATH  Google Scholar 

  40. Vijayaraghavan, S.: A variant of the bakery algorithm with bounded values as a solution to Abraham’s concurrent programming problem. In: Proc. of Design, Analysis and Simulation of Distributed Systems (2003)

    Google Scholar 

  41. Scott, M.L.: Non-blocking timeout in scalable queue-based spin locks. In: Proc. 21th ACM Symp. on Principles of Distributed Computing, July 2002, pp. 31–40 (2002)

    Google Scholar 

  42. Szymanski, B.K.: Mutual exclusion revisited. In: Proc. of the 5th Jerusalem Conf. on Information Technology, October 1990, pp. 110–117 (1990)

    Google Scholar 

  43. Woo, T.: A note on Lamport’s mutual exclusion algorithm. Operating Systems Review (ACM) 24(4), 78–80 (1990)

    Article  Google Scholar 

  44. Yang, J.-H., Anderson, J.H.: Fast, scalable synchronization with minimal hardware support. In: Proc. 12th ACM Symp. on Principles of Distributed Computing, pp. 171–182 (1993)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2004 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Taubenfeld, G. (2004). The Black-White Bakery Algorithm and Related Bounded-Space, Adaptive, Local-Spinning and FIFO Algorithms. In: Guerraoui, R. (eds) Distributed Computing. DISC 2004. Lecture Notes in Computer Science, vol 3274. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-30186-8_5

Download citation

  • DOI: https://doi.org/10.1007/978-3-540-30186-8_5

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-23306-0

  • Online ISBN: 978-3-540-30186-8

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics