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.
- 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 Scholar
- Colby, C. Analyzing the communication topology of concurrent programs. In PEPM'95, June 1995, pp. 202--213. Google Scholar
- 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 Scholar
- 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 Scholar
- 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 Scholar
- 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 Scholar
- 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 Scholar
- Flatt, M. and R. B. Findler. Kill-safe synchronization abstractions. In PLDI'04, June 2004. Google Scholar
- Fisher, K. and J. Reppy. The design of a class mechanism for Moby. In PLDI'99, May 1999, pp. 37--49. Google Scholar
- 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 Scholar
- Hoare, C. A. R. Communicating sequential processes. Communications of the ACM, 21(8), August 1978, pp. 666--677. Google Scholar
- 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 Scholar
- Knabe, F. A distributed protocol for channel-based communication with choice. Technical Report ECRC-92-16, European Computer-industry Research Center, October 1992.Google Scholar
- Leroy, X. The Objective Caml System (release 3.00), April 2000. Available from http://caml.inria.fr.Google Scholar
- 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 Scholar
- Marinescu, M. and B. Goldberg. Partial-evaluation techniques for concurrent programs. In PEPM'97, June 1997, pp. 47--62. Google Scholar
- 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 Scholar
- http://mlton.org/ConcurrentML.Google Scholar
- Milner, R., M. Tofte, R. Harper, and D. MacQueen. The Definition of Standard ML (Revised). The MIT Press, Cambridge, MA, 1997. Google Scholar
- Nielson, H. R. and F. Nielson. Higher-order concurrent programs with finite communication topology. In POPL'94, January 1994, pp. 84--97. Google Scholar
- 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 Scholar
- Reppy, J. H. CML: A higher-order concurrent language. In PLDI'91, New York, NY, June 1991. ACM, pp. 293--305. Google Scholar
- Reppy, J. H. Concurrent Programming in ML. Cambridge University Press, Cambridge, England, 1999. Google Scholar
Digital Library
- Reppy, J. Type-sensitive control-flow analysis. In ML '06, New York, NY, September 2006. ACM, pp. 74--83. Google Scholar
- Russell, G. Events in Haskell, and how to implement them. In ICFP'01, September 2001, pp. 157--168. Google Scholar
- 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 Scholar
- Shivers, O. Control-flow analysis of higher-order languages. Ph.D. dissertation, School of CS, CMU, Pittsburgh, PA, May 1991. Google Scholar
- 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 Scholar
- Xiao, Y. Toward optimization of Concurrent ML. Master's dissertation, University of Chicago, December 2005.Google Scholar
- 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 Scholar
Index Terms
Specialization of CML message-passing primitives
Recommendations
Specialization of CML message-passing primitives
Proceedings of the 2007 POPL ConferenceConcurrent 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 ...
Message analysis for concurrent programs using message passing
We describe an analysis-driven storage allocation scheme for concurrent systems that use message passing with copying semantics. The basic principle is that in such a system, data which is not part of any message does not need to be allocated in a ...
Inferring ownership transfer for efficient message passing
PPoPP '11: Proceedings of the 16th ACM symposium on Principles and practice of parallel programmingOne of the more popular paradigms for concurrent programming is the Actor model of message passing; it has been adopted in one form or another by a number of languages and frameworks. By avoiding a shared local state and instead relying on message ...






Comments