skip to main content
10.1145/3627535.3638487acmconferencesArticle/Chapter ViewAbstractPublication PagesppoppConference Proceedingsconference-collections

Language-Agnostic Static Deadlock Detection for Futures

Published:20 February 2024Publication History

ABSTRACT

Deadlocks, in which threads wait on each other in a cyclic fashion and can't make progress, have plagued parallel programs for decades. In recent years, as the parallel programming mechanism known as futures has gained popularity, interest in preventing deadlocks in programs with futures has increased as well. Various static and dynamic algorithms exist to detect and prevent deadlock in programs with futures, generally by constructing some approximation of the dependency graph of the program but, as far as we are aware, all are specialized to a particular programming language.

A recent paper introduced graph types, by which one can statically approximate the dependency graphs of a program in a language-independent fashion. By analyzing the graph type directly instead of the source code, a graph-based program analysis, such as one to detect deadlock, can be made language-independent. Indeed, the paper that proposed graph types also proposed a deadlock detection algorithm. Unfortunately, the algorithm was based on an unproven conjecture which we show to be false. In this paper, we present, and prove sound, a type system for finding possible deadlocks in programs that operates over graph types and can therefore be applied to many different languages. As a proof of concept, we have implemented the algorithm over a subset of the OCaml language extended with built-in futures.

References

  1. [n.d.]. The Rust language. https://www.rust-lang.org. Accessed: 2023-07-07.Google ScholarGoogle Scholar
  2. Michael A. Bender, Jeremy T. Fineman, Seth Gilbert, and Charles E. Leiserson. 2004. On-the-Fly Maintenance of Series-Parallel Relationships in Fork-Join Multithreaded Programs (SPAA '04). Association for Computing Machinery, New York, NY, USA, 133--144. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Guy E. Blelloch and Margaret Reid-Miller. 1997. Pipelining with Futures. In Proceedings of the Ninth Annual ACM Symposium on Parallel Algorithms and Architectures (Newport, Rhode Island, USA) (SPAA '97). Association for Computing Machinery, New York, NY, USA, 249--259. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Gérard Boudol. 2009. A Deadlock-Free Semantics for Shared Memory Concurrency. In Theoretical Aspects of Computing - ICTAC 2009, Martin Leucker and Carroll Morgan (Eds.). Springer Berlin Heidelberg, Berlin, Heidelberg, 140--154.Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Chandrasekhar Boyapati, Robert Lee, and Martin Rinard. 2002. Ownership Types for Safe Programming: Preventing Data Races and Deadlocks. In Proceedings of the 17th ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications (Seattle, Washington, USA) (OOPSLA '02). Association for Computing Machinery, New York, NY, USA, 211--230. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Vincent Cavé, Jisheng Zhao, Jun Shirako, and Vivek Sarkar. 2011. Habanero-Java: The New Adventures of Old X10. In Proceedings of the 9th International Conference on Principles and Practice of Programming in Java (Kongens Lyngby, Denmark) (PPPJ '11). Association for Computing Machinery, New York, NY, USA, 51--61. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. E. G. Coffman, M. Elphick, and A. Shoshani. 1971. System Deadlocks. ACM Comput. Surv. 3, 2 (Jun 1971), 67--78. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Tiago Cogumbreiro, Rishi Surendran, Francisco Martins, Vivek Sarkar, Vasco T. Vasconcelos, and Max Grossman. 2017. Deadlock Avoidance in Parallel Programs with Futures: Why Parallel Tasks Should Not Wait for Strangers. Proc. ACM Program. Lang. 1, OOPSLA, Article 103 (Oct. 2017), 26 pages. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Dawson Engler and Ken Ashcraft. 2003. RacerX: Effective, Static Detection of Race Conditions and Deadlocks. In Proceedings of the Nineteenth ACM Symposium on Operating Systems Principles (Bolton Landing, NY, USA) (SOSP '03). Association for Computing Machinery, New York, NY, USA, 237--252. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Matteo Frigo, Charles E. Leiserson, and Keith H. Randall. 1998. The Implementation of the Cilk-5 Multithreaded Language. In Proceedings of the ACM SIGPLAN 1998 Conference on Programming Language Design and Implementation (Montreal, Quebec, Canada) (PLDI '98). Association for Computing Machinery, New York, NY, USA, 212--223. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Robert H. Halstead. 1985. MULTILISP: a language for concurrent symbolic computation. ACM Transactions on Programming Languages and Systems 7 (1985), 501--538. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Maurice Herlihy and Zhiyu Liu. 2014. Well-Structured Futures and Cache Locality. In Proceedings of the 19th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming (Orlando, Florida, USA) (PPoPP '14). Association for Computing Machinery, New York, NY, USA, 155--166. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Stephen P. Masticola. 1993. Static Detection of Deadlocks in Polynomial Time. Ph.D. Dissertation. USA. UMI Order No. GAX93-33428.Google ScholarGoogle Scholar
  14. Stefan K. Muller. 2022. Static Prediction of Parallel Computation Graphs. Proc. ACM Program. Lang. 6, POPL, Article 46 (Jan 2022), 31 pages. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Stefan K Muller. 2023. Language-Agnostic Static Deadlock Detection for Futures. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Alan Mycroft. 1984. Polymorphic type schemes and recursive definitions. In International Symposium on Programming, M. Paul and B. Robinet (Eds.). Springer Berlin Heidelberg, Berlin, Heidelberg, 217--228. Google ScholarGoogle ScholarCross RefCross Ref
  17. Mayur Naik, Chang-Seo Park, Koushik Sen, and David Gay. 2009. Effective static deadlock detection. In 2009 IEEE 31st International Conference on Software Engineering. 386--396. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. K. C. Sivaramakrishnan, Stephen Dolan, Leo White, Sadiq Jaffer, Tom Kelly, Anmol Sahoo, Sudha Parimala, Atul Dhiman, and Anil Madhavapeddy. 2020. Retrofitting parallelism onto OCaml. Proc. ACM Program. Lang. 4, ICFP (2020), 113:1--113:30. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Vasco T. Vasconcelos, Francisco Martins, and Tiago Cogumbreiro. 2010. Type Inference for Deadlock Detection in a Multithreaded Polymorphic Typed Assembly Language. Electronic Proceedings in Theoretical Computer Science 17 (feb 2010), 95--109. Google ScholarGoogle ScholarCross RefCross Ref
  20. Caleb Voss, Tiago Cogumbreiro, and Vivek Sarkar. 2019. Transitive Joins: A Sound and Efficient Online Deadlock-Avoidance Policy (PPoPP '19). Association for Computing Machinery, New York, NY, USA, 378--390. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Caleb Voss and Vivek Sarkar. 2021. An Ownership Policy and Deadlock Detector for Promises. In Proceedings of the 26th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming (Virtual Event, Republic of Korea) (PPoPP '21). Association for Computing Machinery, New York, NY, USA, 348--361. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Amy Williams, William Thies, and Michael D. Ernst. 2005. Static Deadlock Detection for Java Libraries. In ECOOP 2005 - Object-Oriented Programming, Andrew P. Black (Ed.). Springer Berlin Heidelberg, Berlin, Heidelberg, 602--629.Google ScholarGoogle Scholar
  23. Yifan Xu, Kyle Singer, and I-Ting Angelina Lee. 2020. Parallel Determinacy Race Detection for Futures. In Proceedings of the 25th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming (San Diego, California) (PPoPP '20). Association for Computing Machinery, New York, NY, USA, 217--231. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Language-Agnostic Static Deadlock Detection for Futures

          Recommendations

          Comments

          Login options

          Check if you have access through your login credentials or your institution to get full access on this article.

          Sign in
          • Article Metrics

            • Downloads (Last 12 months)139
            • Downloads (Last 6 weeks)45

            Other Metrics

          PDF Format

          View or Download as a PDF file.

          PDF

          eReader

          View online with eReader.

          eReader