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

Lightweight asynchrony using parasitic threads

Published:19 January 2010Publication History

ABSTRACT

Message-passing is an attractive thread coordination mechanism because it cleanly delineates points in an execution when threads communicate, and unifies synchronization and communication: a sender is allowed to proceed only when a receiver willing to accept the data being sent is available and vice versa. To enable greater performance, however, asynchronous or non-blocking extensions are usually provided that allow senders and receivers to proceed even if a matching partner is unavailable. Lightweight threads with synchronous message-passing can be used to encapsulate asynchronous message-passing operations, although such implementations have greater thread management costs that can negatively impact scalability and performance.

This paper introduces parasitic threads, a novel mechanism for expressing asynchronous computation, that combines the efficiency of a non-declarative solution with the ease of use provided by languages with first-class channels and lightweight threads. A parasitic thread is a lightweight data structure that encapsulates an asynchronous computation using the resources provided by a host thread. Parasitic threads need not execute cooperatively, impose no restrictions on the computations they encapsulate, or the communication actions they perform, and impose no additional burden on thread scheduling mechanisms.

We describe an implementation of parasitic threads in MLton, a whole-program optimizing compiler and runtime for Standard ML. Benchmark results indicate parasitic threads enable construction of scalable and efficient message-passing parallel programs.

References

  1. Gul Agha. An Overview of Actor Languages. SIGPLAN Not., 21(10):58--67, 1986. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Kunal Agrawal, Yuxiong He, and Charles E. Leiserson. Adaptive Work Stealing with Parallelism Feedback. In PPoPP, pages 112--120, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Joe Armstrong, Robert Virding, Claes Wikstrom, and Mike Williams. Concurrent Programming in Erlang. Prentice-Hall, 2nd edition, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Mark Baker and Bryan Carpenter. Mpj: A proposed java message passing api and environment for high performance computing. In IPDPS, pages 552--559, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Robert D. Blumofe and Charles E. Leiserson. Scheduling Multithreaded Computations by Work Stealing. J. ACM, 46(5):720--748, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Matteo Frigo, Charles E. Leiserson, and Keith H. Randall. The Implementation of the Cilk-5 Multithreaded Language. In PLDI, pages 212--223, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Glasgow Haskell Compiler. http://www.haskell.org/ghc.Google ScholarGoogle Scholar
  8. Tim Harris, Simon Marlow, and Simon Peyton Jones. Haskell on a Shared-Memory Multiprocessor. In Haskell Workshop, pages 49--61, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Wesley M. Johnston, J.R. Paul Hanna, and Richard J. Millar. Advances in Dataflow Programming Languages. ACM Comput. Surv., 36(1):1--34, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. D.A. Kranz, R.H. Halstead, Jr., and E. Mohr. Mul-T: A High-Performance Parallel Lisp. In PLDI, pages 81--90, 1989. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Doug Lea. Concurrent Programming in Java(TM): Design Principles and Pattern. Prentice-Hall, 2nd edition, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Guodong Li, Michael Delisi, Ganesh Gopalakrishnan, and Robert M. Kirby. Formal Specification of the MPI-2.0 Standard in TLA+. In PPoPP, pages 283--284, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. M. Matthias Felleisen and Dan Friedman. Control operators, the SECD Machine, and the λ-calculus. In Formal Description of Programming Concepts III, pages 193--217, 1986.Google ScholarGoogle Scholar
  14. Robin Milner, Mads Tofte, and David Macqueen. The Definition of Standard ML. MIT Press, Cambridge, MA, USA, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. MLton. http://www.mlton.org.Google ScholarGoogle Scholar
  16. Eric Mohr, David A. Kranz, and Robert H. Halstead, Jr. Lazy Task Creation: A Technique for Increasing the Granularity of Parallel Programs. In LFP, pages 185--197, 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Rishiyur Nikhil and Arvind. Implicit Parallel Programming in pH. Morgan-Kaufmann, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. John Reppy and Yingqi Xiao. Specialization of CML Message-Passing Primitives. In POPL, pages 315--326, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. John Reppy and Yingqi Xiao. Towards a Parallel Implementation of Concurrent ML. In DAMP, January 2008.Google ScholarGoogle Scholar
  20. John H. Reppy. Concurrent Programming in ML. Cambridge University Press, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. C# Language Specification. http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-334.pdf.Google ScholarGoogle Scholar
  22. Sriram Srinivasan and Alan Mycroft. Kilim: Isolation-Typed Actors for Java. In ECOOP, pages 104--128, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Don Syme, Adam Granicz, and Antonio Cisternino. Expert F#. Apress, 2007.Google ScholarGoogle Scholar
  24. Hong Tang and Tao Yang. Optimizing Threaded MPI Execution on SMP Clusters. In ICS, pages 381--392, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Rob von Behren, Jeremy Condit, Feng Zhou, George Necula, and Eric Brewer. Capriccio: Scalable Threads for Internet Services. In SOSP, pages 268--281, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Lightweight asynchrony using parasitic 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
              DAMP '10: Proceedings of the 5th ACM SIGPLAN workshop on Declarative aspects of multicore programming
              January 2010
              90 pages
              ISBN:9781605588599
              DOI:10.1145/1708046

              Copyright © 2010 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: 19 January 2010

              Permissions

              Request permissions about this article.

              Request Permissions

              Check for updates

              Qualifiers

              • research-article

              Upcoming Conference

              POPL '25

            PDF Format

            View or Download as a PDF file.

            PDF

            eReader

            View online with eReader.

            eReader