skip to main content
10.1145/1411304.1411307acmconferencesArticle/Chapter ViewAbstractPublication PagesicfpConference Proceedingsconference-collections
research-article

Lwt: a cooperative thread library

Published:21 September 2008Publication History

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.

References

  1. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  2. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  3. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  4. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  5. 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 ScholarGoogle Scholar
  6. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  7. 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 ScholarGoogle Scholar
  8. Gerd Stolpmann. The ocamlnet library. Software and documentation available on the Web, http://projects.camlcity.org/projects/ocamlnet.html.Google ScholarGoogle Scholar
  9. Don Syme, Adam Granicz, and Antonio Cisternino. Expert F#. Apress, 2007.Google ScholarGoogle Scholar
  10. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  11. 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 ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Lwt: a cooperative thread library

          Recommendations

          Comments

          Login options

          Check if you have access through your login credentials or your institution to get full access on this article.

          Sign in
          • Published in

            cover image ACM Conferences
            ML '08: Proceedings of the 2008 ACM SIGPLAN workshop on ML
            September 2008
            106 pages
            ISBN:9781605580623
            DOI:10.1145/1411304

            Copyright © 2008 ACM

            Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

            Publisher

            Association for Computing Machinery

            New York, NY, United States

            Publication History

            • Published: 21 September 2008

            Permissions

            Request permissions about this article.

            Request Permissions

            Check for updates

            Qualifiers

            • research-article

            Acceptance Rates

            Overall Acceptance Rate6of11submissions,55%

            Upcoming Conference

            ICFP '24

          PDF Format

          View or Download as a PDF file.

          PDF

          eReader

          View online with eReader.

          eReader