skip to main content
10.1145/1480881.1480887acmconferencesArticle/Chapter ViewAbstractPublication PagespoplConference Proceedingsconference-collections
research-article

A model of cooperative threads

Authors Info & Claims
Published:21 January 2009Publication History

ABSTRACT

We develop a model of concurrent imperative programming with threads. We focus on a small imperative language with cooperative threads which execute without interruption until they terminate or explicitly yield control. We define and study a trace-based denotational semantics for this language; this semantics is fully abstract but mathematically elementary. We also give an equational theory for the computational effects that underlie the language, including thread spawning. We then analyze threads in terms of the free algebra monad for this theory.

References

  1. Mart'ın Abadi, Andrew Birrell, Tim Harris, and Michael Isard. Semantics of transactional memory and automatic mutual exclusion. In Proceedings of the 35th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 63--74, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Mart'ın Abadi and Gordon D. Plotkin. A logical view of composition. Theoretical Computer Science, 114(1):3--30, June 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Karl Abrahamson. Modal logic of concurrent nondeterministic programs. In Gilles Kahn, editor, International Symposium on Semantics of Concurrent Computation, volume 70 of Lecture Notes in Computer Science, pages 21-33. Springer, 1979. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Atul Adya, Jon Howell, Marvin Theimer, William J. Bolosky, and John R. Douceur. Cooperative task management without manual stack management. In Proceedings of the General Track: the 2002 USENIX Annual Technical Conference, pages 289-302, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Roberto Amadio and Silvano Dal Zilio. Resource control for synchronous cooperative threads. Theoretical Computer Science, 358:229--254, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Nick Benton, John Hughes, and Eugenio Moggi. Monads and effects. In Gilles Barthe, Peter Dybjer, Lu'ıs Pinto, and João Saraiva, editors, Advanced Lectures from International Summer School on Applied Semantics, volume 2395 of Lecture Notes in Computer Science, pages 42--122. Springer, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Dave Berry, Robin Milner, and David N. Turner. A semantics for ML concurrency primitives. In Proceedings of the 19th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 119--129, 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Gérard Boudol. Fair cooperative multithreading. In Luís Caires and Vasco Thudichum Vasconcelos, editors, Concurrency Theory, 18th International Conference, volume 4703 of Lecture Notes in Computer Science, pages 272--286. Springer, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Fréderic Boussinot. Fairthreads: mixing cooperative and preemptive threads in C. Concurrency and Computation: Practice and Experience, 18(5):445--469, April 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Stephen Brookes. Full abstraction for a shared-variable parallel language. Information and Computation, 127(2):145--163, June 1996.Google ScholarGoogle ScholarCross RefCross Ref
  11. Stephen Brookes. The essence of parallel Algol. Information and Computation, 179(1):118--149, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Pietro Cenciarelli and Eugenio Moggi. A syntactic approach to modularity in denotational semantics. In Proceedings of the 5th Biennial Meeting on Category Theory and Computer Science, 1993.Google ScholarGoogle Scholar
  13. William Ferreira and Matthew Hennessy. A behavioural theory of first-order CML. Theoretical Computer Science, 216(1-2):55--107, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Tim Harris, Simon Marlow, Simon Peyton-Jones, and Maurice Herlihy. Composable memory transactions. In Proceedings of the 10th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming, pages 48--60, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Matthew Hennessy and Gordon D. Plotkin. Full abstraction for a simple programming language. In J. Bećvář, editor, 8th Symposium on Mathematical Foundations of Computer Science, volume 74 of Lecture Notes in Computer Science, pages 108--120. Springer, 1979.Google ScholarGoogle Scholar
  16. E. Horita, J. W. de Bakker, and J. J. M. M. Rutten. Fully abstract denotational models for nonuniform concurrent languages. Information and Computation, 115(1):125--178, 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Martin Hyland, Gordon Plotkin, and John Power. Combining effects: Sum and tensor. Theoretical Computer Science, 357(1-3):70--99, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Michael Isard and Andrew Birrell. Automatic mutual exclusion. In Proceedings of the 11th USENIX workshop on Hot Topics in Operating Systems, pages 1--6, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Alan Jeffrey. A fully abstract semantics for a concurrent functional language with monadic types. In Proceedings, Tenth Annual IEEE Symposium on Logic in Computer Science, pages 255--264, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Alan Jeffrey. Semantics for core Concurrent ML using computation types. In Higher order operational techniques in semantics, pages 55--90. Cambridge University Press, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Alan Jeffrey and Julian Rathke. A fully abstract may testing semantics for concurrent objects. Theoretical Computer Science, 338(1-3):17--63, June 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Microsoft. SQL Server 2005 books online. CLR Hosted Environment, at http://msdn.microsoft.com/en-us/library/ms131047.aspx, September 2007.Google ScholarGoogle Scholar
  23. Prakash Panangaden and John H. Reppy. The essence of Concurrent ML. In Flemming Nielson, editor, ML with Concurrency, chapter 1, pages 5--29. Springer, 1997.Google ScholarGoogle Scholar
  24. Gordon Plotkin and John Power. Notions of computation determine monads. Lecture Notes in Computer Science, 2303:373--393, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Gordon D. Plotkin and John Power. Algebraic operations and generic effects. Applied Categorical Structures, 11(1):69--94, 2003.Google ScholarGoogle ScholarCross RefCross Ref
  26. Gordon D. Plotkin and Matija Pretnar. A logic for algebraic effects. In Proceedings, Twenty-Third Annual IEEE Symposium on Logic in Computer Science, pages 118--129, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Nir Shavit and Dan Touitou. Software transactional memory. In Proceedings of the 14th Annual ACM Symposium on Principles of Distributed Computing, pages 204--213, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. Yannis Smaragdakis, Anthony Kay, Reimer Behrends, and Michal Young. Transactions with isolation and cooperation. In Proceedings of the 22nd Annual ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications, pages 191--210, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. J. Robert von Behren, Jeremy Condit, Feng Zhou, George C. Necula, and Eric A. Brewer. Capriccio: scalable threads for Internet services. In Proceedings of the 19th ACM Symposium on Operating Systems Principles, pages 268--281, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Glynn Winskel. The Formal Semantics of Programming Languages. The MIT Press, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. A model of cooperative threads

      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 Conferences
        POPL '09: Proceedings of the 36th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languages
        January 2009
        464 pages
        ISBN:9781605583792
        DOI:10.1145/1480881
        • cover image ACM SIGPLAN Notices
          ACM SIGPLAN Notices  Volume 44, Issue 1
          POPL '09
          January 2009
          453 pages
          ISSN:0362-1340
          EISSN:1558-1160
          DOI:10.1145/1594834
          Issue’s Table of Contents

        Copyright © 2009 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: 21 January 2009

        Permissions

        Request permissions about this article.

        Request Permissions

        Check for updates

        Qualifiers

        • research-article

        Acceptance Rates

        Overall Acceptance Rate824of4,130submissions,20%

        Upcoming Conference

        POPL '25

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader