ABSTRACT
We present a cooperative thread library for Objective Caml. The library is entirely written in Objective Caml and does not rely on any external C function. Programs involving threads are written in a monadic style. This makes it possible to write threaded code almost as regular ML code, even though it has a different semantics. Cooperative threads are especially well suited for concurrent network applications, where threads perform little computation and spend most of their time waiting for input or output, at which time other threads can run. This library has been successfully used in the Unison file synchronizer and the Ocsigen Web server.
- S. Balasubramaniam and Benjamin C. Pierce. What is a file synchronizer? In Fourth Annual ACM/IEEE International Conference on Mobile Computing and Networking (MobiCom '98), October 1998. Full version available as Indiana University CSCI technical report #507, April 1998. Google ScholarDigital Library
- Vincent Balat. Ocsigen: Typing Web interaction with Objective Caml. In International Workshop on ML, pages 84--94. ACM Press, 2006. ISBN 1-59593-483-9. doi: http://doi.acm.org/10.1145/1159876.1159889. Google ScholarDigital Library
- Nick Benton and Andrew Kennedy. Exceptional syntax. J. Funct. Program., 11(4):395--410, 2001. ISSN 0956-7968. doi: http://dx.doi.org/10.1017/S0956796801004099. Google ScholarDigital Library
- Koen Claessen. A poor man's concurrency monad. J. Funct. Program., 9(3):313--323, 1999. ISSN 0956-7968. doi: http://dx.doi.org/10.1017/S0956796899003342. Google ScholarDigital Library
- Xavier Leroy, Damien Doligez, Jacques Garrigue, Jérôme Vouillon, and Dider Rémy. The Objective Caml system. Software and documentation available on the Web, http://pauillac.inria.fr/ocaml/.Google Scholar
- Peng Li and Steve Zdancewic. Combining events and threads for scalable network services implementation and evaluation of monadic, application-level concurrency primitives. In PLDI '07: Proceedings of the 2007 ACM SIGPLAN conference on Programming language design and implementation, pages 189--199, New York, NY, USA, 2007. ACM. ISBN 978-1-59593-633-2. doi: http://doi.acm.org/10.1145/1250734.1250756. Google ScholarDigital Library
- Benjamin C. Pierce and Jérôme Vouillon. What's in Unison? A formal specification and reference implementation of a file synchronizer. Technical Report MS-CIS-03-36, Dept. of Computer and Information Science, University of Pennsylvania, 2004.Google Scholar
- Gerd Stolpmann. The ocamlnet library. Software and documentation available on the Web, http://projects.camlcity.org/projects/ocamlnet.html.Google Scholar
- Don Syme, Adam Granicz, and Antonio Cisternino. Expert F#. Apress, 2007.Google Scholar
- Rob von Behren, Jeremy Condit, and Eric Brewer. Why events are a bad idea (for high-concurrency servers). In HOTOS'03: Proceedings of the 9th conference on Hot Topics in Operating Systems, pages 4--4, Berkeley, CA, USA, 2003. USENIX Association. Google ScholarDigital Library
- Chris Waterson. An ocaml-based network services platform. In CUFP'07: Proceedings of the 4th ACM SIGPLAN workshop on Commercial users of functional programming, pages 1--2, New York, NY, USA, 2007. ACM. doi: http://doi.acm.org/10.1145/1362702.1362711. Google ScholarDigital Library
Index Terms
- Lwt: a cooperative thread library
Recommendations
Combining events and threads for scalable network services implementation and evaluation of monadic, application-level concurrency primitives
PLDI '07: Proceedings of the 28th ACM SIGPLAN Conference on Programming Language Design and ImplementationThis paper proposes to combine two seemingly opposed programming models for building massively concurrent network services: the event-driven model and the multithreaded model. The result is a hybrid design that offers the best of both worlds--the ease ...
Combining events and threads for scalable network services implementation and evaluation of monadic, application-level concurrency primitives
Proceedings of the 2007 PLDI conferenceThis paper proposes to combine two seemingly opposed programming models for building massively concurrent network services: the event-driven model and the multithreaded model. The result is a hybrid design that offers the best of both worlds--the ease ...
Lightweight concurrency primitives for GHC
Haskell '07: Proceedings of the ACM SIGPLAN workshop on Haskell workshopThe Glasgow Haskell Compiler (GHC) has quite sophisticated support for concurrency in its runtime system, which is written in low-level C code. As GHC evolves, the runtime system becomes increasingly complex, error-prone, difficult to maintain and ...
Comments