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.
Similar content being viewed by others
References
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.
Cejtin, H., Jagannathan, S., and Kelsey, R. Higher-order distributed objects. ACM Transactions on Programming Languages and Systems, 17(5) (1995) 704–739.
CGI 1.0: 1999, CGI: Common Gateway Interface. http://www.w3.org/CGI/.
Dybvig, R.K. and Hieb, R. Engines from continuations. Computer Languages, 14(2) (1989) 109–123.
Feeley, M. Parameters in Gambit-C. Personal communication, (2001).
Feeley, M. SRFI 39: Parameter objects, (2002) http://srfi.schemers.org/srfi-39/.
Flatt, M. PLT MzScheme: Language Manual. Rice University, University of Utah. Version 203, (2003).
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.
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.
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.
Haynes, C.T. and Friedman, D.P. Engines build process abstractions. In ACM Conference on Lisp and Functional Programming 1984, pp. 18–24.
Haynes, C.T. and Friedman, D.P. Abstracting timed preemption with engines. Computer Languages, 12(2) (1987a) 109–121.
Haynes, C.T. and Friedman, D.P. Embedding continuations in procedural objects. ACM Transactions on Programming Languages and Systems, 9(4) (1987b) 582–598.
Jackson, I. and Finch, T. GNU adns, (2000) http://www.chiark.greenend.org.uk/∼ian/adns/.
Kelsey, R. SRFI 9: Defining Record Types, (1999) http://srfi.schemers.org/srfi-9/.
Kelsey, R., Clinger, W., and Rees, J. Revised5 report on the algorithmic language Scheme. Higher-Order and Symbolic Computation, 11(1) (1998) 7–105.
Kelsey, R. and Rees, J. Scheme 48 reference manual. Part of the Scheme 48 distribution at http://www.s48.org/, 2002.
Kelsey, R.A. and Rees, J.A. A tractable Scheme implementation. Lisp and Symbolic Computation, 7(4) (1995) 315–335.
Netscape: Netscape Browser Central, 2002. http://browsers.netscape.com/browsers/main.tmpl.
Nye, A. Xlib Reference Manual, Vol. 2 of The Definitive Guides to the X Window System. O'Reilly, 1992.
POSIX. The Open Group Base Specifications Issue 6 IEEE Std 1003.1-2001, 2001. http://www.opengroup.org/onlinepubs/007904975/.
Reppy, J.H. Concurrent Programming in ML. Cambridge University Press, 1999.
Shivers, O. A Scheme shell. Technical Report TR-635, Massachusetts Institute of Technology, Laboratory for Computer Science, 1994.
Squid: Squid Web Proxy Cache, 2002, http://www.squid-cache.org/.
SRFI-39 mailing list. 2002. http://srfi.schemers.org/srfi-39/mail-archive/maillist.html/.
SUnet. The Scheme Untergrund Networking Package, 2003. http://www.scsh.net/sunet/.
Author information
Authors and Affiliations
Corresponding author
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
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
Issue Date:
DOI: https://doi.org/10.1007/s10990-005-4879-2