skip to main content
research-article

AC: composable asynchronous IO for native languages

Published:22 October 2011Publication History
Skip Abstract Section

Abstract

This paper introduces AC, a set of language constructs for composable asynchronous IO in native languages such as C/C++. Unlike traditional synchronous IO interfaces, AC lets a thread issue multiple IO requests so that they can be serviced concurrently, and so that long-latency operations can be overlapped with computation. Unlike traditional asynchronous IO interfaces, AC retains a sequential style of programming without requiring code to use multiple threads, and without requiring code to be "stack-ripped" into chains of callbacks. AC provides an "async" statement to identify opportunities for IO operations to be issued concurrently, a "do..finish" block that waits until any enclosed "async" work is complete, and a "cancel" statement that requests cancellation of unfinished IO within an enclosing "do..finish". We give an operational semantics for a core language. We describe and evaluate implementations that are integrated with message passing on the Barrelfish research OS, and integrated with asynchronous file and network IO on Microsoft Windows. We show that AC offers comparable performance to existing C/C++ interfaces for asynchronous IO, while providing a simpler programming model.

References

  1. POSIX 1003.1--2008. The Open Group, 2008. http://www.opengroup.org/onlinepubs/9699919799/toc.htm.Google ScholarGoogle Scholar
  2. M. Abadi. Automatic mutual exclusion and atomicity checks. In Concurrency, Graphs and Models: Essays Dedicated to Ugo Montanari on the Occasion of His 65th Birthday, pages 510--526. Springer-Verlag, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. A. Adya, J. Howell, M. Theimer, W. J. Bolosky, and J. R. Douceur. Cooperative task management without manual stack management. In USENIX-02: Proc. 2002 Annual Technical Conference, pages 289--302, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. A. Baumann, P. Barham, P.-E. Dagand, T. Harris, R. Isaacs, S. Peter, T. Roscoe, A. Schüpbach, and A. Singhania. The multikernel: a new OS architecture for scalable multicore systems. In SOSP '09: Proc. 22nd Symposium on Operating Systems Principles, pages 29--44, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. A. Birrell, J. Guttag, J. Horning, and R. Levin. Synchronization primitives for a multiprocessor: a formal specification. In SOSP '87: Proc. 11th Symposium on Operating Systems Principles, pages 94--102, 1987. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. P. Chandrasekaran, C. L. Conway, J. M. Joy, and S.K. Rajamani. Programming asynchronous layers with CLARITY. In ESEC-FSE '07: Proc. 6th European Software Engineering Conference & Symposium on the Foundations of Software Engineering, pages 65--74, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. P. Charles, C. Grothoff, V. Saraswat, C. Donawa, A. Kielstra, K. Ebcioglu, C. von Praun, and V. Sarkar. X10: an object-oriented approach to non-uniform cluster computing. In OOPSLA '05: Proc. 20th Conference on Object-Oriented Programming, Systems, Languages, and Applications, pages 519--538, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. R. Cunningham and E. Kohler. Making events less slippery with eel. In HotOS '05: Proc. 10th Conference on Hot Topics in Operating Systems, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. F. Dabek, N. Zeldovich, F. Kaashoek, D. Mazières, and R. Morris. Event-driven programming for robust software. In Proc. 10th ACM SIGOPS European Workshop, pages 186--189, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. A. Dunkels, O. Schmidt, T. Voigt, and M. Ali. Protothreads: simplifying event-driven programming of memory-constrained embedded systems. In SenSys '06: Proc. 4th Conference on Embedded Networked Sensor Systems, pages 29--42, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. K. Elmeleegy, A. Chanda, A. L. Cox, and W. Zwaenepoel. Lazy asynchronous I/O for event-driven servers. In USENIX-04: Proc. 2004 Annual Technical Conference, pages 21--21, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. J. Fischer, R. Majumdar, and T. Millstein. Tasks: language support for event-driven programming. In PEPM '07: Proc. 2007 Symposium on Partial Evaluation and Semantics-Based Program Manipulation, pages 134--143, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. M. Frigo, C.E. Leiserson, and K.H. Randall. The implementation of the Cilk-5 multithreaded language. In PLDI '98: Proc. 1998 Conference on Programming Language Design and Implementation, pages 212--223, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. S. C. Goldstein. Lazy Threads Compiler and Runtime Structures for Fine-Grained Parallel Programming. PhD thesis, University of California--Berkeley, Berkeley, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. P. Haller and M. Odersky. Scala actors: Unifying thread-based and event-based programming. Theor. Comput. Sci., 410(2--3):202--220, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. E. A. Hauck and B. A. Dent. Burroughs' B6500/B7500 stack mechanism. In AFIPS '68: Proc. of the Spring Joint Computer Conference, pages 245--251, 1968. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. C. A. R. Hoare. Communicating sequential processes. Commun. ACM, 21(8):666--677, 1978. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Intel Corporation. Single-chip cloud computer. http://techresearch.intel.com/articles/Tera-Scale/1826.htm, December 2009.Google ScholarGoogle Scholar
  19. M. Isard and A. Birrell. Automatic mutual exclusion. In HotOS '07: Proc. 11th Workshop on Hot Topics in Operating Systems, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. J. Howard et al. A 48-core IA-32 message-passing processor with DVFS in 45nm CMOS. In ISSCC '10: Proc. Solid-State Circuits Conference, pages 108--109, 2010.Google ScholarGoogle Scholar
  21. G. Kerneis and J. Chroboczek. CPC: programming with a massive number of lightweight threads. In PLACES '11: Proc. Workshop on Programming Language Approaches to Concurrency and Communication-Centric Software, 2011.Google ScholarGoogle Scholar
  22. M. Krohn, E. Kohler, and M. F. Kaashoek. Events can make sense. In USENIX-07: Proc. 2007 Annual Technical Conference, pages 1--14, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. H. C. Lauer and R. M. Needham. On the duality of operating system structures. In Proc. 2nd International Symposium on Operating Systems, IRIA, 1978.Google ScholarGoogle Scholar
  24. J.K. Lee and J. Palsberg. Featherweight X10: a core calculus for async-finish parallelism. In PPoPP '10: Proc. 15th Symposium on Principles and Practice of Parallel Programming, pages 25--36, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. P. Li and S. Zdancewic. Combining events and threads for scalable network services implementation and evaluation of monadic, application-level concurrency primitives. In PLDI '07: Proc. 2007 Conference on Programming Language Design and Implementation, pages 189--199, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. E. Mohr, D. A. Kranz, and R. H. Halstead, Jr. Lazy task creation: A technique for increasing the granularity of parallel programs. IEEE Trans. Parallel Distrib. Syst., 2:264--280, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. J. Ousterhout. Why threads are a bad idea (for most purposes). Presentation given at the 1996 Usenix Annual Technical Conference.Google ScholarGoogle Scholar
  28. J. H. Reppy. Concurrent Programming in ML. Cambridge University Press, Cambridge, England, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. K. C. Sivaramakrishnan, L. Ziarek, R. Prasad, and S. Jagannathan. Lightweight asynchrony using parasitic threads. In DAMP '10: Proc. 2010 Workshop on Declarative Aspects of Multicore Programming, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Y. Smaragdakis, A. Kay, R. Behrends, and M. Young. Transactions with isolation and cooperation. In OOPSLA '07: Proc. 22nd Conference on Object Oriented Programming Systems and Applications, pages 191--210, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. S. Srinivasan and A. Mycroft. Kilim: Isolation-typed actors for Java. In ECOOP '08: Proc. 22nd European Conference on Object-Oriented Programming, pages 104--128, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. D. Syme, T. Petricek, and D. Lomov. The F# asynchronous programming model. In PADL '11: Proc. 13th International Symposium on Practical Aspects of Declarative Languages, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. K. Taura, K. Tabata, and A. Yonezawa. StackThreads/MP: integrating futures into calling standards. In PPoPP '99: Proc. 7th Symposium on Principles and Practice of Parallel Programming, pages 60--71, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. C. Thacker. Beehive: A many-core computer for FPGAs (v5). MSR Silicon Valley, January 2010. http://projects.csail.mit.edu/beehive/BeehiveV5.pdf.Google ScholarGoogle Scholar
  35. R. von Behren, J. Condit, and E. Brewer. Why events are a bad idea (for high-concurrency servers). In HotOS '03: Proc. 9th Conference on Hot Topics in Operating Systems, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. R. von Behren, J. Condit, F. Zhou, G. C. Necula, and E. Brewer. Capriccio: scalable threads for internet services. In SOSP '03: Proc. 19th Symposium on Operating Systems Principles, pages 268--281, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. J. Vouillon. Lwt: a cooperative thread library. In ML '08: Proc. 2008 Workshop on ML, pages 3--12, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. D. Wentzlaff, C. Gruenwald III, N. Beckmann, K. Modzelewski, A. Belay, L. Youseff, J. Miller, and A. Agarwal. An operating system for multicore and clouds: Mechanisms and implementation. In SOCC '10: Proc. 2010 Symposium on Cloud Computing, pages 3--14, June 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. P. Winterbottom. Alef language reference manual. Technical report, Bell Labs, 1995.Google ScholarGoogle Scholar
  40. L. Ziarek, K. C. Sivaramakrishnan, and S. Jagannathan. Composable asynchronous events. In PLDI '11: Proc. 2011 Conference on Programming Language Design and Implementation, pages 628--639, June 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. AC: composable asynchronous IO for native languages

      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

      Full Access

      • Published in

        cover image ACM SIGPLAN Notices
        ACM SIGPLAN Notices  Volume 46, Issue 10
        OOPSLA '11
        October 2011
        1063 pages
        ISSN:0362-1340
        EISSN:1558-1160
        DOI:10.1145/2076021
        Issue’s Table of Contents
        • cover image ACM Conferences
          OOPSLA '11: Proceedings of the 2011 ACM international conference on Object oriented programming systems languages and applications
          October 2011
          1104 pages
          ISBN:9781450309400
          DOI:10.1145/2048066

        Copyright © 2011 ACM

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 22 October 2011

        Check for updates

        Qualifiers

        • research-article

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader
      About Cookies On This Site

      We use cookies to ensure that we give you the best experience on our website.

      Learn more

      Got it!