Higher-Order and Symbolic Computation

, Volume 18, Issue 3–4, pp 327–354 | Cite as

Integrating User-Level Threads with Processes in Scsh



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.


threads Unix Scheme continuations 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 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. 2.
    Cejtin, H., Jagannathan, S., and Kelsey, R. Higher-order distributed objects. ACM Transactions on Programming Languages and Systems, 17(5) (1995) 704–739.CrossRefGoogle Scholar
  3. 3.
    CGI 1.0: 1999, CGI: Common Gateway Interface. http://www.w3.org/CGI/.
  4. 4.
    Dybvig, R.K. and Hieb, R. Engines from continuations. Computer Languages, 14(2) (1989) 109–123.CrossRefGoogle Scholar
  5. 5.
    Feeley, M. Parameters in Gambit-C. Personal communication, (2001).Google Scholar
  6. 6.
    Feeley, M. SRFI 39: Parameter objects, (2002) http://srfi.schemers.org/srfi-39/.
  7. 7.
    Flatt, M. PLT MzScheme: Language Manual. Rice University, University of Utah. Version 203, (2003).Google Scholar
  8. 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.Google Scholar
  9. 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.Google Scholar
  10. 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.Google Scholar
  11. 11.
    Haynes, C.T. and Friedman, D.P. Engines build process abstractions. In ACM Conference on Lisp and Functional Programming 1984, pp. 18–24.Google Scholar
  12. 12.
    Haynes, C.T. and Friedman, D.P. Abstracting timed preemption with engines. Computer Languages, 12(2) (1987a) 109–121.CrossRefGoogle Scholar
  13. 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.CrossRefGoogle Scholar
  14. 14.
    Jackson, I. and Finch, T. GNU adns, (2000) http://www.chiark.greenend.org.uk/∼ian/adns/.
  15. 15.
    Kelsey, R. SRFI 9: Defining Record Types, (1999) http://srfi.schemers.org/srfi-9/.
  16. 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.Google Scholar
  17. 17.
    Kelsey, R. and Rees, J. Scheme 48 reference manual. Part of the Scheme 48 distribution at http://www.s48.org/, 2002.
  18. 18.
    Kelsey, R.A. and Rees, J.A. A tractable Scheme implementation. Lisp and Symbolic Computation, 7(4) (1995) 315–335.Google Scholar
  19. 19.
    Netscape: Netscape Browser Central, 2002. http://browsers.netscape.com/browsers/main.tmpl.
  20. 20.
    Nye, A. Xlib Reference Manual, Vol. 2 of The Definitive Guides to the X Window System. O'Reilly, 1992.Google Scholar
  21. 21.
    POSIX. The Open Group Base Specifications Issue 6 IEEE Std 1003.1-2001, 2001. http://www.opengroup.org/onlinepubs/007904975/.
  22. 22.
    Reppy, J.H. Concurrent Programming in ML. Cambridge University Press, 1999.Google Scholar
  23. 23.
    Shivers, O. A Scheme shell. Technical Report TR-635, Massachusetts Institute of Technology, Laboratory for Computer Science, 1994.Google Scholar
  24. 24.
    Squid: Squid Web Proxy Cache, 2002, http://www.squid-cache.org/.
  25. 25.
  26. 26.
    SUnet. The Scheme Untergrund Networking Package, 2003. http://www.scsh.net/sunet/.

Copyright information

© Springer Science + Business Media, Inc. 2005

Authors and Affiliations

  1. 1.Universität TübingenTübingenGermany
  2. 2.TübingenGermany

Personalised recommendations