skip to main content
10.1145/3561320.3561325acmotherconferencesArticle/Chapter ViewAbstractPublication PagessblpConference Proceedingsconference-collections
research-article

Exploring Opacity Software Transactional Memory in Haskell through Graph Transformation

Published:06 October 2022Publication History

ABSTRACT

Software Transactional Memory (STM) is considered an alternative abstraction for concurrent programming, it has shown to be more approachable when compared to it’s main counterpart, lock-based synchronization. Haskell included language support very early through the STM Haskell library, that allows concurrent lock-free programming using composable atomic actions that manipulate transactional variables. In this work, we explore the correctness criterion Opacity and CO-Opacity for the STM Haskell algorithm using a Graph Transformation System (GTS) approach. Even though Opacity can be demonstrated in Haskell using other STM algorithms, the original STM Haskell library does not satisfy it. Using a GTS to represent the execution of the original STM Haskell, we demonstrate it’s correctness, or lack thereof, using the graph characterization of the criterion. We also compare it to a GTS for the TL2 algorithm, to observe how the algorithms differ in decision making, and how it affects the correctness of the execution.

References

  1. Bowen Alpern and Fred B Schneider. 1985. Defining liveness. Information processing letters 21, 4 (1985), 181–185.Google ScholarGoogle Scholar
  2. Anshu S Anand, RK Shyamasundar, and Sathya Peri. 2016. Opacity proof for CaPR+ algorithm. In Proceedings of the 17th International Conference on Distributed Computing and Networking. 1–4.Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Parwat Singh Anjana, Sweta Kumari, Sathya Peri, Sachin Rathor, and Archit Somani. 2019. An efficient framework for optimistic concurrent execution of smart contracts. In 2019 27th Euromicro International Conference on Parallel, Distributed and Network-Based Processing (PDP). IEEE, 83–92.Google ScholarGoogle ScholarCross RefCross Ref
  4. Paolo Baldan, Andrea Corradini, Fernando Luís Dotti, Luciana Foss, Fabio Gadducci, and Leila Ribeiro. 2008. Towards a notion of transaction in graph rewriting. Electronic Notes in Theoretical Computer Science 211 (2008), 39–50.Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. M. Bardohl, R.and Minas, G. Taentzer, and A. Schurr. 1999. Application of graph transformation to visual languages. Handbook of graph grammars and computing by graph transformation 2 (1999), 105.Google ScholarGoogle Scholar
  6. Victor Bushkov, Dmytro Dziuma, Panagiota Fatourou, and Rachid Guerraoui. 2013. Snapshot isolation does not scale either. Technical Report. Technical Report TR-437, Foundation of Research and Technology–Hellas (FORTH).Google ScholarGoogle Scholar
  7. Diogo J. Cardoso, Luciana Foss, and André R. Du Bois. 2019. A Graph Transformation System formalism for Software Transactional Memory Opacity. In Proceedings of the XXIII Brazilian Symposium on Programming Languages. 3–10.Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Diogo J. Cardoso, Luciana Foss, and André R. Du Bois. 2021. A Graph Transformation System formalism for correctness of Transactional Memory algorithms. In 25th Brazilian Symposium on Programming Languages. 49–57.Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Diogo J. Cardoso, Luciana Foss, and André R. Du Bois. 2021. A Methodology for Opacity verification for Transactional Memory algorithms using Graph Transformation System. In Anais do VI Workshop-Escola de Informática Teórica. SBC, 9–16.Google ScholarGoogle Scholar
  10. Simone André da Costa Cavalheiro, Luciana Foss, and Leila Ribeiro. 2017. Theorem proving graph grammars with attributes and negative application conditions. Theoretical computer science 686 (2017), 25–77.Google ScholarGoogle Scholar
  11. Edmund M. Clarke, E Allen Emerson, and A Prasad Sistla. 1986. Automatic verification of finite-state concurrent systems using temporal logic specifications. ACM Transactions on Programming Lang. and Sys. (TOPLAS) 8, 2(1986), 244–263.Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Dave Dice, Ori Shalev, and Nir Shavit. 2006. Transactional locking II. In International Symposium on Distributed Computing. Springer, 194–208.Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Thomas Dickerson, Paul Gazzillo, Maurice Herlihy, and Eric Koskinen. 2020. Adding concurrency to smart contracts. Distributed Computing 33, 3 (2020), 209–225.Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Simon Doherty, Lindsay Groves, Victor Luchangco, and Mark Moir. 2009. Towards formally specifying and verifying transactional memory. Electronic Notes in Theoretical Computer Science 259 (2009), 245–261.Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Hartmut Ehrig, Grzegorz Rozenberg, and Hans-J rg Kreowski. 1999. Handbook of graph grammars and computing by graph transformation. Vol. 3. world Scientific.Google ScholarGoogle Scholar
  16. EA Emerson and JY Halpern. 1986. On branching versus linear time temporal logic. J. ACM 33, 1 (1986), 151–178.Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. E Allen Emerson and Edmund M Clarke. 1982. Using branching time temporal logic to synthesize synchronization skeletons. SCP 2, 3 (1982), 241–266.Google ScholarGoogle ScholarCross RefCross Ref
  18. Amir Hossein Ghamarian, Maarten de Mol, Arend Rensink, Eduardo Zambon, and Maria Zimakova. 2012. Modelling and analysis using GROOVE. International journal on software tools for technology transfer 14, 1(2012), 15–40.Google ScholarGoogle Scholar
  19. Rachid Guerraoui and Michal Kapalka. 2007. Opacity: A correctness condition for transactional memory. Technical Report.Google ScholarGoogle Scholar
  20. Rachid Guerraoui and Michal Kapalka. 2008. On the correctness of transactional memory. In Proceedings of the 13th ACM SIGPLAN Symposium on Principles and practice of parallel programming. ACM, 175–184.Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Rachid Guerraoui and Michał Kapałka. 2010. Principles of transactional memory. Synthesis Lectures on Distributed Computing 1, 1 (2010), 1–193.Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Tim Harris, Simon Marlow, Simon Peyton-Jones, and Maurice Herlihy. 2005. Composable memory transactions. In Proceedings of the tenth ACM SIGPLAN symposium on Principles and practice of parallel programming. 48–60.Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Reiko Heckel. 2006. Graph transformation in a nutshell. Electronic notes in theoretical computer science 148, 1 (2006), 187–198.Google ScholarGoogle Scholar
  24. Maurice Herlihy and J Eliot B Moss. 1993. Transactional memory: Architectural support for lock-free data structures. In Proceedings of the 20th annual international symposium on Computer architecture. 289–300.Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Damien Imbs and Michel Raynal. 2012. Virtual world consistency: A condition for STM systems (with a versatile protocol with invisible read operations). Theoretical Computer Science 444 (2012), 113–127.Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Priyanka Kumar and Sathya Peri. 2015. Multiversion Conflict Notion for Transactional Memory Systems. arXiv preprint arXiv:1509.04048(2015).Google ScholarGoogle Scholar
  27. Priyanka Kumar, Sathya Peri, and K Vidyasankar. 2014. A timestamp based multi-version stm algorithm. In International Conference on Distributed Computing and Networking. Springer, 212–226.Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. Sweta Kumari and Sathya Peri. 2019. Exploring Progress Guarantees in Multi-Version Software Transactional Memory Systems. Ph. D. Dissertation. Indian Institute of Technology Hyderabad.Google ScholarGoogle Scholar
  29. Petr Kuznetsov and Sathya Peri. 2017. Non-interference and local correctness in transactional memory. Theoretical Computer Science 688 (2017), 103–116.Google ScholarGoogle ScholarCross RefCross Ref
  30. Matthew Le, Ryan Yates, and Matthew Fluet. 2016. Revisiting software transactional memory in Haskell. ACM SIGPLAN Notices 51, 12 (2016), 105–113.Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. Mohsen Lesani and Jens Palsberg. 2014. Decomposing opacity. In International Symposium on Distributed Computing. Springer, 391–405.Google ScholarGoogle ScholarCross RefCross Ref
  32. Heiner Litz, David Cheriton, Amin Firoozshahian, Omid Azizi, and John P Stevenson. 2014. SI-TM: Reducing transactional memory abort rates through snapshot isolation. In Proceedings of the 19th international conference on Architectural support for programming languages and operating systems. 383–398.Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. Nancy A Lynch. 1996. Distributed algorithms. Elsevier.Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. Christos H Papadimitriou. 1979. The serializability of concurrent database updates. Journal of the ACM (JACM) 26, 4 (1979), 631–653.Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. Christina Peterson and Damian Dechev. 2017. A transactional correctness tool for abstract data types. ACM Transactions on Architecture and Code Optimization (TACO) 14, 4(2017), 1–24.Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. Michel Raynal, Gérard Thia-Kime, and Mustaque Ahamad. 1997. From serializable to causal transactions for collaborative applications. In EUROMICRO 97. Proceedings of the 23rd EUROMICRO Conference: New Frontiers of Information Technology (Cat. No. 97TB100167). IEEE, 314–321.Google ScholarGoogle ScholarCross RefCross Ref
  37. Arend Rensink, Maarten De Mol, and Eduardo Zambon. 2022. GROOVE GRaphs for Object-Oriented VErification (Version 5.8.1). https://groove.cs.utwente.nl/Google ScholarGoogle Scholar
  38. David Sabel. 2014. A Haskell-Implementation of STM Haskell with Early Conflict Detection.. In Software Engineering (Workshops). 171–190.Google ScholarGoogle Scholar
  39. Nir Shavit and Dan Touitou. 1997. Software transactional memory. Distributed Computing 10, 2 (1997), 99–116.Google ScholarGoogle ScholarCross RefCross Ref
  40. Gerhard Weikum and Gottfried Vossen. 2001. Transactional information systems: theory, algorithms, and the practice of concurrency control and recovery. Elsevier.Google ScholarGoogle Scholar
  41. Jingna Zeng. 2020. Augmenting Transactional Memory with the Future Abstraction. Ph. D. Dissertation. KTH Royal Institute of Technology.Google ScholarGoogle Scholar

Index Terms

  1. Exploring Opacity Software Transactional Memory in Haskell through Graph Transformation

        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
        • Published in

          cover image ACM Other conferences
          SBLP '22: Proceedings of the XXVI Brazilian Symposium on Programming Languages
          October 2022
          75 pages
          ISBN:9781450397445
          DOI:10.1145/3561320

          Copyright © 2022 ACM

          Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

          Publisher

          Association for Computing Machinery

          New York, NY, United States

          Publication History

          • Published: 6 October 2022

          Permissions

          Request permissions about this article.

          Request Permissions

          Check for updates

          Qualifiers

          • research-article
          • Research
          • Refereed limited

          Acceptance Rates

          Overall Acceptance Rate22of50submissions,44%
        • Article Metrics

          • Downloads (Last 12 months)12
          • Downloads (Last 6 weeks)1

          Other Metrics

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader

        HTML Format

        View this article in HTML Format .

        View HTML Format