Skip to main content
Log in

Integrating User-Level Threads with Processes in Scsh

  • Published:
Higher-Order and Symbolic Computation

Abstract

Scsh, the Scheme shell, enables concurrent system programming with portable user-level threads. In scsh, threads behave like processes in many ways: each thread receives its own set of process resources; like Unix processes, new threads can inherit resources from the creating thread. The combination of scsh's interface to the POSIX API with user-level threads creates a number of design and implementation challenges: Scsh's abstractions for managing process resources raise interesting modularity issues, particularly in connection with first-class continuations. Scsh also provides an interface to the fork system call; its implementation must avoid common pitfalls that arise with a user-level thread system. This paper describes the design and implementation of the relevant abstractions and discusses the implications for programming-language and system design.

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. Biagioni, E., Cline, K., Lee, P., Okasaki, C., and Stone, C. Safe-for-space threads in Standard ML. Higher-Order and Symbolic Computation, 11(2) (1998) 209–225.

    Google Scholar 

  2. Cejtin, H., Jagannathan, S., and Kelsey, R. Higher-order distributed objects. ACM Transactions on Programming Languages and Systems, 17(5) (1995) 704–739.

    Article  Google Scholar 

  3. CGI 1.0: 1999, CGI: Common Gateway Interface. http://www.w3.org/CGI/.

  4. Dybvig, R.K. and Hieb, R. Engines from continuations. Computer Languages, 14(2) (1989) 109–123.

    Article  Google Scholar 

  5. Feeley, M. Parameters in Gambit-C. Personal communication, (2001).

  6. Feeley, M. SRFI 39: Parameter objects, (2002) http://srfi.schemers.org/srfi-39/.

  7. Flatt, M. PLT MzScheme: Language Manual. Rice University, University of Utah. Version 203, (2003).

  8. Flatt, M., Findler, R.B., Krishnamurthi, S., and Felleisen, M. Programming languages as operating systems. In Proc. International Conference on Functional Programming 1999 P. Lee (Ed.) Paris, France, ACM Press: New York, 1999, pp. 138–147.

  9. Gasbichler, M., Knauel, E., Sperber, M., and Kelsey, R. How to add threads to a sequential language without getting tangled up. In Proceedings of the Fourth Workshop on Scheme and Functional Programming M. Flatt (Ed.). Boston, 2003.

  10. Graunke, P., Krishnamurthi, S., Hoeven, S.V.D., and Felleisen, M. Programming the web with High-Level Programming Languages. In Proceedings of the 2001 European Symposium on Programming D. Sands (Ed.) Springer-Verlag Genova, Italy, pp. 122–136, 2001.

  11. Haynes, C.T. and Friedman, D.P. Engines build process abstractions. In ACM Conference on Lisp and Functional Programming 1984, pp. 18–24.

  12. Haynes, C.T. and Friedman, D.P. Abstracting timed preemption with engines. Computer Languages, 12(2) (1987a) 109–121.

    Article  Google Scholar 

  13. Haynes, C.T. and Friedman, D.P. Embedding continuations in procedural objects. ACM Transactions on Programming Languages and Systems, 9(4) (1987b) 582–598.

    Article  Google Scholar 

  14. Jackson, I. and Finch, T. GNU adns, (2000) http://www.chiark.greenend.org.uk/∼ian/adns/.

  15. Kelsey, R. SRFI 9: Defining Record Types, (1999) http://srfi.schemers.org/srfi-9/.

  16. Kelsey, R., Clinger, W., and Rees, J. Revised5 report on the algorithmic language Scheme. Higher-Order and Symbolic Computation, 11(1) (1998) 7–105.

  17. Kelsey, R. and Rees, J. Scheme 48 reference manual. Part of the Scheme 48 distribution at http://www.s48.org/, 2002.

  18. Kelsey, R.A. and Rees, J.A. A tractable Scheme implementation. Lisp and Symbolic Computation, 7(4) (1995) 315–335.

    Google Scholar 

  19. Netscape: Netscape Browser Central, 2002. http://browsers.netscape.com/browsers/main.tmpl.

  20. Nye, A. Xlib Reference Manual, Vol. 2 of The Definitive Guides to the X Window System. O'Reilly, 1992.

  21. POSIX. The Open Group Base Specifications Issue 6 IEEE Std 1003.1-2001, 2001. http://www.opengroup.org/onlinepubs/007904975/.

  22. Reppy, J.H. Concurrent Programming in ML. Cambridge University Press, 1999.

  23. Shivers, O. A Scheme shell. Technical Report TR-635, Massachusetts Institute of Technology, Laboratory for Computer Science, 1994.

  24. Squid: Squid Web Proxy Cache, 2002, http://www.squid-cache.org/.

  25. SRFI-39 mailing list. 2002. http://srfi.schemers.org/srfi-39/mail-archive/maillist.html/.

  26. SUnet. The Scheme Untergrund Networking Package, 2003. http://www.scsh.net/sunet/.

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Martin Gasbichler.

Additional information

This article is a revised and extended version of the paper Processes vs. User-Level Threads in Scsh that appeared in Proceedings of the Third Workshop on Scheme and Functional Programming, Pittsburgh, USA, 2002.

Partially supported by Universität Tübingen.

Rights and permissions

Reprints and permissions

About this article

Cite this article

Gasbichler, M., Sperber, M. Integrating User-Level Threads with Processes in Scsh. Higher-Order Symb Comput 18, 327–354 (2005). https://doi.org/10.1007/s10990-005-4879-2

Download citation

  • Issue Date:

  • DOI: https://doi.org/10.1007/s10990-005-4879-2

Keywords

Navigation