Implementing threads in Standard ML
This tutorial explores the well-known problem of how to implement concurrent threads of control in Standard ML, by using the extension of first-class continuations. Particular attention is paid to the proper treatment of exceptions and avoidance of storage leaks.
KeywordsException Handler Main Thread Child Process Current Thread Ready Queue
Unable to display preview. Download preview PDF.
- 1.Abelson, H. Sussman, G. J., and Sussman, J.: Structure and Interpretation of Computer Programs. MIT Press (1985).Google Scholar
- 2.Appel, A. W. and MacQueen, D. B.: A Standard ML compiler. Proceedings of the Conference on Functional Programming Languages and Computer Architecture, Lecture Notes in Computer Science 274, Springer-Verlag, 301–324 (1987).Google Scholar
- 3.Bershad, B., Savage, S., Pardyak, P., Sirer, E. G, Becker, D., Fiuczynski, M., Chambers, C., and Eggers, S.: Extensibility, safety and performance in the SPIN operating system. Proceedings of the 1995 Symposium on Operating System Principles, 267–284 (December 1995).Google Scholar
- 4.Biagioni, E., Harper, R., and Lee, P. Signatures for a protocol stack: a systems application of Standard ML. Proceedings of the 1994 ACM Conference on Lisp and Functional Programming, Orlando (June 1994).Google Scholar
- 5.Birrell, A. D.: An Introduction to Programming with Threads. Technical Report 35, DEC Systems Research Center (January 1989).Google Scholar
- 6.Cooper, E. C. and Morrisett, J. G.: Adding Threads to Standard ML. Technical Report CMU-CS-90-186, School of Computer Science, Carnegie Mellon University (December 1990).Google Scholar
- 7.Haynes, C. T., Friedman, D. P., and Wand, M.: Obtaining coroutines with continuations. Computer Languages, 11(3–4), 143–53 (1986).Google Scholar
- 8.Milner, R., Tofte, M., and Harper, R.: The Definition of Standard ML. MIT Press, Cambridge, Massachusetts (1990).Google Scholar
- 9.Reppy, J. H.: CML: a higher-order concurrent language. ACM SIGPLAN '91 Conference on Programming Language Design and Implementation, Toronto, 293–305 (June 1991).Google Scholar
- 10.Springer, G., Friedman, D. P.: Scheme and the Art of Programming. McGraw-Hill, New York (1989).Google Scholar