skip to main content
10.1145/1190216.1190264acmconferencesArticle/Chapter ViewAbstractPublication PagespoplConference Proceedingsconference-collections
Article

Specialization of CML message-passing primitives

Published:17 January 2007Publication History

ABSTRACT

Concurrent ML (CML) is a statically-typed higher-order concurrent language that is embedded in Standard ML. Its most notable feature is its support for first-class synchronous operations. This mechanism allows programmers to encapsulate complicated communication and synchronization protocols as first-class abstractions, which encourages a modular style of programming where the underlying channels used to communicate with a given thread are hidden behind data and type abstraction.While CML has been in active use for well over a decade, little attention has been paid to optimizing CML programs. In this paper, we present a new program analysis for statically-typed higher-order concurrent languages that enables the compile-time specialization of communication operations. This specialization is particularly important in a multiprocessor or multicore setting, where the synchronization overhead for general-purpose operations are high. Preliminary results from a prototype that we have built demonstrate that specialized channel operations are much faster than the general-purpose operations.Our analysis technique is modular (i.e.,, it analyzes and optimizes a single unit of abstraction at a time), which plays to the modular style of many CML programs. The analysis consists of three steps: the first is a type-sensitive control-flow analysis that uses the program's type-abstractions to compute more precise results. The second is the construction of an extended control-flow graph using the results of the CFA. The last step is an iterative analysis over the graph that approximates the usage patterns of known channels. Our analysis is designed to detect special patterns of use, such as one-shot channels, fan-in channels, and fan-out channels. We have proven the safety of our analysis and state those results.

References

  1. Arvind, R. S. Nikhil, and K. K. Pingali. I-structures: Data structures for parallel computing. ACM Transactions on Programming Languages and Systems, 11(4), October 1989, pp. 598--632. Google ScholarGoogle Scholar
  2. Colby, C. Analyzing the communication topology of concurrent programs. In PEPM'95, June 1995, pp. 202--213. Google ScholarGoogle Scholar
  3. Carlsson, R., K. Sagonas, and J. Wilhelmsson. Message analysis for concurrent languages. In SAS '03, vol. 2694 of LNCS, New York, NY, 2003. Springer-Verlag, pp. 73--90. Google ScholarGoogle Scholar
  4. 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
  5. Demaine, E. D. Protocols for non-deterministic communication over synchronous channels. In Proceedings of the 12th International Parallel Processing Symposium and 9th Symposium on Parallel and Distributed Processing (IPPS/SPDP'98), March 1998, pp. 24--30. Available from http://theory.csail.mit.edu/~edemaine/papers/IPPS98/. Google ScholarGoogle Scholar
  6. Debbabi, M., A. Faour, and N. Tawbi. Efficient type-based control-flow analysis of higher-order concurrent programs. In Proceedings of the International Workshop on Functional and Logic Programming, IFL'96, vol. 1268 of LNCS, New York, N.Y., September 1996. Springer-Verlag, pp. 247--266. Google ScholarGoogle Scholar
  7. Felleisen, M. and D. P. Friedman. Control operators, the SECD-machine, and the λ-calculus. In M. Wirsing (ed.), Formal Description of Programming Concepts -- III, pp. 193--219. North-Holland, New York, N.Y., 1986.Google ScholarGoogle Scholar
  8. Flatt, M. and R. B. Findler. Kill-safe synchronization abstractions. In PLDI'04, June 2004. Google ScholarGoogle Scholar
  9. Fisher, K. and J. Reppy. The design of a class mechanism for Moby. In PLDI'99, May 1999, pp. 37--49. Google ScholarGoogle Scholar
  10. 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 Scholar
  11. Hoare, C. A. R. Communicating sequential processes. Communications of the ACM, 21(8), August 1978, pp. 666--677. Google ScholarGoogle Scholar
  12. Jagannathan, S. and S. Weeks. Analyzing stores and references in a parallel symbolic language. In LFP'94, New York, NY, June 1994. ACM, pp. 294--305. Google ScholarGoogle Scholar
  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 Scholar
  14. Leroy, X. The Objective Caml System (release 3.00), April 2000. Available from http://caml.inria.fr.Google ScholarGoogle Scholar
  15. Mercouroff, N. An algorithm for analyzing communicating processes. In 7th International Conference on the Mathematical Foundations of Programming Semantics, vol. 598 of LNCS, New York, NY, March 1991. Springer-Verlag, pp. 312--325. Google ScholarGoogle Scholar
  16. Marinescu, M. and B. Goldberg. Partial-evaluation techniques for concurrent programs. In PEPM'97, June 1997, pp. 47--62. Google ScholarGoogle Scholar
  17. Martel, M. and M. Gengler. Communication topology analysis for concurrent programs. In 7th International SPIN Workshop, vol. 1885 of LNCS, New York, NY, September 2000. Springer-Verlag, pp. 265--286. Google ScholarGoogle Scholar
  18. http://mlton.org/ConcurrentML.Google ScholarGoogle Scholar
  19. Milner, R., M. Tofte, R. Harper, and D. MacQueen. The Definition of Standard ML (Revised). The MIT Press, Cambridge, MA, 1997. Google ScholarGoogle Scholar
  20. Nielson, H. R. and F. Nielson. Higher-order concurrent programs with finite communication topology. In POPL'94, January 1994, pp. 84--97. Google ScholarGoogle Scholar
  21. Reif, J. H. Data flow analysis of communicating processes. In POPL '79: Proceedings of the 6th ACM SIGACT-SIGPLAN symposium on Principles of programming languages, New York, NY, USA, January 1979. ACM Press, pp. 257--268. Google ScholarGoogle Scholar
  22. Reppy, J. H. CML: A higher-order concurrent language. In PLDI'91, New York, NY, June 1991. ACM, pp. 293--305. Google ScholarGoogle Scholar
  23. Reppy, J. H. Concurrent Programming in ML. Cambridge University Press, Cambridge, England, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Reppy, J. Type-sensitive control-flow analysis. In ML '06, New York, NY, September 2006. ACM, pp. 74--83. Google ScholarGoogle Scholar
  25. Russell, G. Events in Haskell, and how to implement them. In ICFP'01, September 2001, pp. 157--168. Google ScholarGoogle Scholar
  26. Serrano, M. Control flow analysis: a functional languages compilation paradigm. In SAC '95: Proceedings of the 1995 ACM symposium on Applied Computing, New York, NY, 1995. ACM, pp. 118--122. Google ScholarGoogle Scholar
  27. Shivers, O. Control-flow analysis of higher-order languages. Ph.D. dissertation, School of CS, CMU, Pittsburgh, PA, May 1991. Google ScholarGoogle Scholar
  28. Vasconcelos, V., A. Ravara, and S. Gay. Session types for functional multithreading. In CONCUR'04, vol. 3170 of LNCS. Springer-Verlag, New York, NY, September 2004, pp. 497--511.Google ScholarGoogle Scholar
  29. Xiao, Y. Toward optimization of Concurrent ML. Master's dissertation, University of Chicago, December 2005.Google ScholarGoogle Scholar
  30. Young, C., L. YN, T. Szymanski, J. Reppy, R. Pike, G. Narlikar, S. Mullender, and E. Grosse. Protium, an infrastructure for partitioned applications. In Proceedings of the Eighth IEEE Workshop on Hot Topics in Operating Systems (HotOS), January 2001, pp. 41--46. Google ScholarGoogle Scholar

Index Terms

  1. Specialization of CML message-passing primitives

                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

                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!