Nothing Special   »   [go: up one dir, main page]

skip to main content
research-article

Concurrent disjoint set union

Published: 01 December 2021 Publication History

Abstract

We develop and analyze concurrent algorithms for the disjoint set union (“union-find” ) problem in the shared memory, asynchronous multiprocessor model of computation, with CAS (compare and swap) or DCAS (double compare and swap) as the synchronization primitive. We give a deterministic bounded wait-free algorithm that uses DCAS and has a total work bound of O(m·lognpm+1+αn,mnp) for a problem with n elements and m operations solved by p processes, where α is a functional inverse of Ackermann’s function. We give two randomized algorithms that use only CAS and have the same work bound in expectation. The analysis of the second randomized algorithm is valid even if the scheduler is adversarial. Our DCAS and randomized algorithms take O(logn) steps per operation, worst-case for the DCAS algorithm, high-probability for the randomized algorithms. Our work and step bounds grow only logarithmically with p, making our algorithms truly scalable. We prove that for a class of symmetric algorithms that includes ours, no better step or work bound is possible. Our work is theoretical, but Alistarh et al (In search of the fastest concurrent union-find algorithm, 2019), Dhulipala et al (A framework for static and incremental parallel graph connectivity algorithms, 2020) and Hong et al (Exploring the design space of static and incremental graph connectivity algorithms on gpus, 2020) have implemented some of our algorithms on CPUs and GPUs and experimented with them. On many realistic data sets, our algorithms run as fast or faster than all others.

References

[1]
Alistarh, D., Fedorov, A., Koval, N.: In search of the fastest concurrent union-find algorithm (2019)
[2]
Aghazadeh, Z., Golab, W., Woelfel, P.: Making objects writable. In: Proceedings of the 2014 ACM Symposium on Principles of Distributed Computing, PODC ’14, pp. 385–395. Association for Computing Machinery, New York
[3]
Anderson, R.J., Woll, H.: Wait-free parallel algorithms for the union-find problem. In: Proceedings of the 23rd Annual ACM Symposium on Theory of Computing, May 5-8, 1991, New Orleans, Louisiana, USA, pp. 370–380 (1991)
[4]
Bloemen, V.: On-The-Fly Parallel Decomposition of Strongly Connected Components. Master’s thesis, University of Twente (2015)
[5]
Blum, N.: On the single-operation worst-case time complexity of the disjoint set union problem. In: Annual Symposium on Theoretical Aspects of Computer Science, STACS 1985 (1985)
[6]
Bloemen, V., Laarman, A., van de Pol, J.: Multi-core on-the-fly scc decomposition. In: Proceedings of the 21st ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming, PPoPP ’16, page to appear (2016)
[7]
Chor, B., Israeli, A., Li, M.: On processor coordination using asynchronous hardware. In: Proceedings of the Sixth Annual ACM Symposium on Principles of Distributed Computing, PODC ’87, pp. 86–97. Association for Computing Machinery, New York (1987)
[8]
Chung, F., Lu, L.: Concentration Inequalities and Martingale Inequalities: A Survey, pp. 79–127. Internet Mathematics (2005)
[9]
Cole R and Vishkin U Deterministic coin tossing with applications to optimal parallel list ranking Inf. Control 1986 70 1 32-53
[10]
Dhulipala, L., Hong, C., Shun, J.: Connectit: a framework for static and incremental parallel graph connectivity algorithms (2020)
[11]
Ellen, F., Woelfel, P.: An optimal implementation of fetch-and-increment. In: Proceedings of the 27th International Symposium on Distributed Computing - Volume 8205, DISC 2013, pp. 284–298. Springer, New York (2013)
[12]
Fraczak W, Georgiadis L, Miller A, and Tarjan RE Finding dominators via disjoint set union J. Discrete Algor. 2013 23 2-20
[13]
Fischer, M. J.: Efficiency of equivalence algorithms. In: Complexity of Computer Computations, pp. 153–167. Springer, New York (1972)
[14]
Fredman, M.L., Saks, M.E.: The cell probe complexity of dynamic data structures. In: Proceedings of the 21st Annual ACM Symposium on Theory of Computing, May 14–17, 1989, Seattle, Washigton, USA, pp. 345–354 (1989)
[15]
Galler BA and Fisher MJ An improved equivalence algorithm Commun. ACM 1964 7 5 301-303
[16]
Goel, A., Khanna, S., Larkin, D.H., Tarjan, R.E.: Disjoint set union with randomized linking. In: Proceedings of the Twenty-Fifth Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2014, Portland, Oregon, USA, January 5–7, 2014, pp. 1005–1017 (2014)
[17]
Hong, C., Dhulipala, L., Shun, J.: Exploring the design space of static and incremental graph connectivity algorithms on gpus. In: Proceedings of the ACM International Conference on Parallel Architectures and Compilation Techniques (2020)
[18]
Herlihy M Wait-free synchronization ACM Trans. Program. Lang. Syst. 1991 13 1 124-149
[19]
Harris, T.L., Fraser, K., Pratt, I.A.: A practical multi-word compare-and-swap operation. In: Proceedings of the 16th International Conference on Distributed Computing, DISC ’02, pp. 265–279, London, UK. Springer, New York (2002)
[20]
Herlihy, M., Eliot, J., Moss, B.: Transactional memory:architectural support for lock-free data structures. SIGARCH Comput. Archit. News, 21(2), 289–300 (1993)
[21]
Herlihy M and Shavit N The Art of Multiprocessor Programming 2008 San Francisco Morgan Kaufmann Publishers Inc.
[22]
Hopcroft JE and Ullman JD Set merging algorithms SIAM J. Comput. 1973 2 4 294-303
[23]
Herlihy MP and Wing JM Linearizability: a correctness condition for concurrent objects ACM Trans. Program. Lang. Syst. 1990 12 3 463-492
[24]
Halperin S and Zwick U Optimal randomized erew pram algorithms for finding spanning forests J. Algor. 2001 39 1 1-46
[25]
Jayanti, P.: A complete and constant time wait-free implementation of CAS from LL/SC and vice versa. In: Distributed Computing, 12th International Symposium, DISC ’98, Andros, Greece, September 24–26, 1998, Proceedings, pp. 216–230 (1998)
[26]
Jayanti, P.: A time complexity lower bound for randomized implementations of some shared objects. In: Proceedings of the Seventeenth Annual ACM Symposium on Principles of Distributed Computing, PODC ’98, pp. 201–210. ACM, New York (1998)
[27]
Johnson DB and Metaxas P Connected components ino (log3/2 n) parallel time for the crew pram J Comput Syst Sci 1997 54 2 227-242
[28]
Jayanti, S.V., Tarjan, R.E.: A randomized concurrent algorithm for disjoint set union. In: Proceedings of the 2016 ACM Symposium on Principles of Distributed Computing, PODC ’16, pp. 75–82. ACM, New York (2016)
[29]
Jayanti, S., Tarjan, R.E., Boix-Adserà, E.: Randomized concurrent set union and generalized wake-up. In: Proceedings of the 2019 ACM Symposium on Principles of Distributed Computing, PODC ’19, pp. 187–196. Association for Computing Machinery, New York (2019)
[30]
Kozen DC The Design and Analysis of Algorithms 1992 Berlin, Heidelberg Springer
[31]
Kruskal JB On the shortest spanning subtree of a graph and the traveling salesman problem Proc. Am. Math. Soc. 1956 7 1 48-50
[32]
Lattner C and Adve V Automatic pool allocation for disjoint data structures SIGPLAN Not. 2002 38 2 supplement 13-24
[33]
Liu, S., Tarjan, R.E.: Simple concurrent labeling algorithms for connected components. In: Fineman, J.T., Mitzenmacher, M. (Eds.) 2nd Symposium on Simplicity in Algorithms (SOSA 2019), Volume 69 of OpenAccess Series in Informatics (OASIcs), pp. 3:1–3:20. Schloss Dagstuhl–Leibniz-Zentrum fuer Informatik, Dagstuhl (2018)
[34]
Michael MM Hazard pointers: safe memory reclamation for lock-free objects IEEE Trans. Parallel Distrib. Syst. 2004 15 6 491-504
[35]
Motorolla. Programmer’s reference manual. https://www.nxp.com/files-static/archives/doc/ref_manual/M68000PRM.pdf. Accessed 07 Sept 2018
[36]
Reif J Depth first search is inherently sequential Inform. Process. Lett. 1985 1 2 229-234
[37]
Rastogi, V., Machanavajjhala, A., Chitnis, L., Das Sarma, A.: Finding connected components on map-reduce in logarithmic rounds. In: Proceedings - International Conference on Data Engineering 03 (2012)
[38]
Sharir M A strong-connectivity algorithm and its applications in data flow analysis Comput. Math. Appl. 1981 7 1 67-72
[39]
Shiloach Y and Vishkin U An o(logn) parallel connectivity algorithm J. Algor. 1982 3 1 57-67
[40]
Sedgewick R and Wayne K Algorithms 2011 4 London Addison-Wesley
[41]
Tarjan, R.: Depth first search and linear graph algorithms. Siam J. Comput. 1(2), (1972)
[42]
Tarjan, R.: Testing flow graph reducibility. In: Proceedings of the Fifth Annual ACM Symposium on Theory of Computing, pp. 96–107 (1973)
[43]
Tarjan R Finding dominators in directed graphs SIAM J. Comput. 1974 3 1 62-89
[44]
Robert Endre Tarjan Efficiency of a good but not linear set union algorithm J. ACM 1975 22 2 215-225
[45]
Tarjan RE and van Leeuwen J Worst-case analysis of set union algorithms J. ACM 1984 31 2 245-281
[46]
Wolper, P.: Lectures on formal methods and performance analysis. In: Brinksma, H., Holger, K., Joost-Pieter (Eds.) Lectures on Formal Methods and Performance Analysis. Chapter Constructing Automata from Temporal Logic Formulas: A Tutorial, pp. 261–277. Springer, New York (2002)

Cited By

View all
  • (2024)Meta-Configuration Tracking for Machine-Certified Correctness of Concurrent Data Structures (Abstract)Proceedings of the 2024 ACM Workshop on Highlights of Parallel Computing10.1145/3670684.3673406(21-22)Online publication date: 17-Jun-2024
  • (2024)A Universal, Sound, and Complete Forward Reasoning Technique for Machine-Verified Proofs of LinearizabilityProceedings of the ACM on Programming Languages10.1145/36329248:POPL(2456-2484)Online publication date: 5-Jan-2024
  • (2024)Parallel k-Core Decomposition with Batched Updates and Asynchronous ReadsProceedings of the 29th ACM SIGPLAN Annual Symposium on Principles and Practice of Parallel Programming10.1145/3627535.3638508(286-300)Online publication date: 2-Mar-2024
  • Show More Cited By

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image Distributed Computing
Distributed Computing  Volume 34, Issue 6
Dec 2021
75 pages

Publisher

Springer-Verlag

Berlin, Heidelberg

Publication History

Published: 01 December 2021
Accepted: 22 December 2020
Received: 14 November 2016

Author Tags

  1. Algorithms
  2. Data structures
  3. Concurrent
  4. Union find
  5. Linearizable
  6. Wait free

Qualifiers

  • Research-article

Funding Sources

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)0
  • Downloads (Last 6 weeks)0
Reflects downloads up to 13 Nov 2024

Other Metrics

Citations

Cited By

View all
  • (2024)Meta-Configuration Tracking for Machine-Certified Correctness of Concurrent Data Structures (Abstract)Proceedings of the 2024 ACM Workshop on Highlights of Parallel Computing10.1145/3670684.3673406(21-22)Online publication date: 17-Jun-2024
  • (2024)A Universal, Sound, and Complete Forward Reasoning Technique for Machine-Verified Proofs of LinearizabilityProceedings of the ACM on Programming Languages10.1145/36329248:POPL(2456-2484)Online publication date: 5-Jan-2024
  • (2024)Parallel k-Core Decomposition with Batched Updates and Asynchronous ReadsProceedings of the 29th ACM SIGPLAN Annual Symposium on Principles and Practice of Parallel Programming10.1145/3627535.3638508(286-300)Online publication date: 2-Mar-2024
  • (2024)Lower Bounds on the Amortized Time Complexity of Shared ObjectsTheory of Computing Systems10.1007/s00224-024-10184-w68:5(1372-1426)Online publication date: 1-Oct-2024
  • (2023)Provably-Efficient and Internally-Deterministic Parallel Union-FindProceedings of the 35th ACM Symposium on Parallelism in Algorithms and Architectures10.1145/3558481.3591082(261-271)Online publication date: 17-Jun-2023

View Options

View options

Get Access

Login options

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media