skip to main content
research-article

Parallel concurrent ML

Published:31 August 2009Publication History
Skip Abstract Section

Abstract

Concurrent ML (CML) is a high-level message-passing language that supports the construction of first-class synchronous abstractions called events. This mechanism has proven quite effective over the years and has been incorporated in a number of other languages. While CML provides a concurrent programming model, its implementation has always been limited to uniprocessors. This limitation is exploited in the implementation of the synchronization protocol that underlies the event mechanism, but with the advent of cheap parallel processing on the desktop (and laptop), it is time for Parallel CML.

Parallel implementations of CML-like primitives for Java and Haskell exist, but build on high-level synchronization constructs that are unlikely to perform well. This paper presents a novel, parallel implementation of CML that exploits a purpose-built optimistic concurrency protocol designed for both correctness and performance on shared-memory multiprocessors. This work extends and completes an earlier protocol that supported just a strict subset of CML with synchronization on input, but not output events. Our main contributions are a model-checked reference implementation of the protocol and two concrete implementations. This paper focuses on Manticore's functional, continuation-based implementation but briefly discusses an independent, thread-based implementation written in C# and running on Microsoft's stock, parallel runtime. Although very different in detail, both derive from the same design. Experimental evaluation of the Manticore implementation reveals good performance, dispite the extra overhead of multiprocessor synchronization.

Skip Supplemental Material Section

Supplemental Material

parallelconcurrentmlonvimeo.mp4

References

  1. Bornat, R. A protocol for generalized occam. SP&E, 16(9), September 1986, pp. 783--799. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Buckley, G. N. and A. Silberschatz. An effective implementation for the generalized input-output construct of CSP. ACM TOPLAS, 5(2), April 1983, pp. 223--235. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. The .NET Common Language Runtime. See http://msdn.microsoft.com/en-gb/netframework/.Google ScholarGoogle Scholar
  4. Chrysanthakopoulos, G. and S. Singh. An asynchronous messaging library for C#. In Synchronization and Concurrency in Object-Oriented Languages (SCOOL), OOPSLA 2005 Workshop. UR Research, October 2005.Google ScholarGoogle Scholar
  5. Demaine, E. D. Higher-order concurrency in Java. In WoTUG20, April 1997, pp. 34--47. Available from http://theory.csail.mit.edu/ edemaine/papers/WoTUG20/.Google ScholarGoogle Scholar
  6. Demaine, E. D. Protocols for non-deterministic communication over synchronous channels. In IPPS/SPDP'98, March 1998, pp. 24--30. Available from http://theory.csail.mit.edu/ edemaine/papers/IPPS98/. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Donnelly, K. and M. Fluet. Transactional events. In ICFP '06, Portland, Oregon, USA, 2006. ACM, pp. 124--135. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Flatt, M. and R. B. Findler. Kill-safe synchronization abstractions. In PLDI '04, June 2004, pp. 47--58. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. 7}manticore-ml07Fluet, M., N. Ford, M. Rainey, J. Reppy, A. Shaw, and Y. Xiao. Status report: The Manticore project. In ML '07. ACM, October 2007, pp. 15--24. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Fluet, M., M. Rainey, and J. Reppy. A scheduling framework for general-purpose parallel languages. In ICFP '08, Victoria, BC, Candada, September 2008. ACM, pp. 241--252. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Gansner, E. R. and J. H. Reppy. A Multi-threaded Higher-order User Interface Toolkit, vol. 1 of Software Trends, pp. 61--80. John Wiley&Sons, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Herlihy, M. and N. Shavit. The Art of Multiprocessor Programming. Morgan Kaufmann Publishers, New York, NY, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Knabe, F. A distributed protocol for channel-based communication with choice. Technical Report ECRC-92-16, European Computer-industry Research Center, October 1992.Google ScholarGoogle ScholarCross RefCross Ref
  14. Leroy, X. The Objective Caml System (release 3.00), April 2000. Available from http://caml.inria.fr.Google ScholarGoogle Scholar
  15. mlton-concurMLton. Concurrent ML. Available at http://mlton.org/ConcurrentML.Google ScholarGoogle Scholar
  16. Musuvathi, M. and S. Qadeer. Iterative context bounding for systematic testing of multithreaded programs. In PLDI '07, San Diego, CA, June 2007. ACM, pp. 446--455. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Milner, R., M. Tofte, R. Harper, and D. MacQueen. The Definition of Standard ML (Revised). The MIT Press, Cambridge, MA, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Reppy, J. H. Synchronous operations as first-class values. In PLDI '88, June 1988, pp. 250--259. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Reppy, J. H. CML: A higher-order concurrent language. In PLDI '91. ACM, June 1991, pp. 293--305. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Reppy, J. H. Concurrent Programming in ML. Cambridge University Press, Cambridge, England, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Ritson, C. Multicore scheduling for lightweight communicating processes. Talk at the Workshop on Language and Runtime Support for Concurrent Systems, October 2008. Slides available from http://www.mm-net.org.uk/workshop171008/mmw07-slides.Google ScholarGoogle Scholar
  22. Russell, G. Events in Haskell, and how to implement them. In ICFP '01, September 2001, pp. 157--168. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Reppy, J. and Y. Xiao. Specialization of CML message-passing primitives. In POPL '07. ACM, January 2007, pp. 315--326. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Reppy, J. and Y. Xiao. Toward a parallel implementation of Concurrent ML. In DAMP '08. ACM, January 2008.Google ScholarGoogle Scholar
  25. TG2, E. T. C# language specification. See http://www.ecma-international.org/publications/standards/Ecma-334.htm.Google ScholarGoogle Scholar
  26. Vella, K. Seamless parallel computing on heterogeneous networks of multiprocessor workstations. Ph.D. dissertation, University of Kent at Canterbury, December 1998.Google ScholarGoogle Scholar
  27. Young, C., L. YN, T. Szymanski, J. Reppy, R. Pike, G. Narlikar, S. Mullender, and E. Grosse. Protium, an infrastructure for partitioned applications. In HotOS-X, January 2001, pp. 41--46.Google ScholarGoogle ScholarCross RefCross Ref

Index Terms

  1. Parallel concurrent ML

          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

          Full Access

          • Published in

            cover image ACM SIGPLAN Notices
            ACM SIGPLAN Notices  Volume 44, Issue 9
            ICFP '09
            September 2009
            343 pages
            ISSN:0362-1340
            EISSN:1558-1160
            DOI:10.1145/1631687
            Issue’s Table of Contents
            • cover image ACM Conferences
              ICFP '09: Proceedings of the 14th ACM SIGPLAN international conference on Functional programming
              August 2009
              364 pages
              ISBN:9781605583327
              DOI:10.1145/1596550

            Copyright © 2009 ACM

            Publisher

            Association for Computing Machinery

            New York, NY, United States

            Publication History

            • Published: 31 August 2009

            Check for updates

            Qualifiers

            • research-article

          PDF Format

          View or Download as a PDF file.

          PDF

          eReader

          View online with eReader.

          eReader
          About Cookies On This Site

          We use cookies to ensure that we give you the best experience on our website.

          Learn more

          Got it!