Skip to main content
Log in

Safe-for-Space Threads in Standard ML

  • Published:
Higher-Order and Symbolic Computation

Abstract

Threads can easily be implemented using first-class continuations, but the straightforward approaches for doing so lead to space leaks, especially in a language with exceptions like Standard ML. We show how these space leaks arise and give a new implementation for threads that is safe for space.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  1. Appel, A.W. and MacQueen, D.B. A Standard ML compiler. In Proceedings of the Conference on Functional Programming Languages and Computer Architecture, Lecture Notes in Computer Science. Springer-Verlag, 1987, vol. 274, pp. 301–324.

    Google Scholar 

  2. Biagioni, E., Harper, R., Lee, P., and Milnes, B.G. Signatures for a protocol stack: A systems application of Standard ML. In Proceedings of the 1994 ACM Conference on Lisp and Functional Programming, Orlando, pp. 55–64, June 1994.

  3. Clinger, W.D. Proper tail recursion and space efficiency. In ACM SIGPLAN '98 Conference on Programming Language Design and Implementation, pp. 174–185, June 1998.

  4. 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, Dec. 1990.

  5. Danvy, O. and Filinski, A. Abstracting control. In Proceedings of the 1990 ACM Conference on Lisp and Functional Programming, pp. 151–160, June 1990.

  6. Felleisen, M. The theory and practice of first-class prompts. In Proceedings of the 15th ACM Symposium on Principles of Programming Languages, pp. 180–190, Jan. 1988.

  7. Gunter, C.A., Rémy, D., and Riecke, J.G. A generalization of exceptions and control in ML-like languages. In Proceedings of the 1995 Conference on Functional Programming Languages and Computer Architecture, pp. 12–23, June 1995.

  8. Haynes, C.T., Friedman, D.P., and Wand, M. Obtaining coroutines with continuations. Computer Languages, 11(3-4):143–153, 1986.

    Google Scholar 

  9. Lee, P. Implementing threads in Standard ML. In Advanced Functional Programming, Lecture Notes in Computer Science, vol. 1129, pp. 115–130, Aug. 1996.

  10. Milner, R., Tofte, M., and Harper, R. The Definition of Standard ML. The MIT Press, Cambridge, MA, 1990.

    Google Scholar 

  11. Nelson, G. (Ed.) Systems Programming with MODULA-3. Prentice Hall, Englewood Cliffs, NJ, 1991.

    Google Scholar 

  12. Reppy, J.H. CML: A higher-order concurrent language. In ACM SIGPLAN '91 Conference on Programming Language Design and Implementation, pp. 293–305, June 1991.

  13. Reppy, J.H. Higher-order concurrency. Ph.D. thesis, Department of Computer Science, Cornell University, Ithaca, New York, Jan. 1992.

    Google Scholar 

  14. Wand, M. Continuation-based multiprocessing. In Proceedings of the 1980 LISP Conference, pp. 19–28, Aug. 1980.

Download references

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

About this article

Cite this article

Biagioni, E., Cline, K., Lee, P. et al. Safe-for-Space Threads in Standard ML. Higher-Order and Symbolic Computation 11, 209–225 (1998). https://doi.org/10.1023/A:1010016600604

Download citation

  • Issue Date:

  • DOI: https://doi.org/10.1023/A:1010016600604

Navigation