Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
research-article

AC: composable asynchronous IO for native languages

Published: 22 October 2011 Publication History

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.
[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.
[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.
[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.
[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.
[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.
[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.
[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.
[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.
[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.
[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.
[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.
[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.
[14]
S. C. Goldstein. Lazy Threads Compiler and Runtime Structures for Fine-Grained Parallel Programming. PhD thesis, University of California--Berkeley, Berkeley, 1997.
[15]
P. Haller and M. Odersky. Scala actors: Unifying thread-based and event-based programming. Theor. Comput. Sci., 410(2--3):202--220, 2009.
[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.
[17]
C. A. R. Hoare. Communicating sequential processes. Commun. ACM, 21(8):666--677, 1978.
[18]
Intel Corporation. Single-chip cloud computer. http://techresearch.intel.com/articles/Tera-Scale/1826.htm, December 2009.
[19]
M. Isard and A. Birrell. Automatic mutual exclusion. In HotOS '07: Proc. 11th Workshop on Hot Topics in Operating Systems, 2007.
[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.
[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.
[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.
[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.
[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.
[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.
[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.
[27]
J. Ousterhout. Why threads are a bad idea (for most purposes). Presentation given at the 1996 Usenix Annual Technical Conference.
[28]
J. H. Reppy. Concurrent Programming in ML. Cambridge University Press, Cambridge, England, 1999.
[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.
[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.
[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.
[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.
[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.
[34]
C. Thacker. Beehive: A many-core computer for FPGAs (v5). MSR Silicon Valley, January 2010. http://projects.csail.mit.edu/beehive/BeehiveV5.pdf.
[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.
[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.
[37]
J. Vouillon. Lwt: a cooperative thread library. In ML '08: Proc. 2008 Workshop on ML, pages 3--12, 2008.
[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.
[39]
P. Winterbottom. Alef language reference manual. Technical report, Bell Labs, 1995.
[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.

Cited By

View all
  • (2021)A concurrency model for JavaScript with cooperative cancellationProceedings of the 14th ACM SIGPLAN International Conference on Software Language Engineering10.1145/3486608.3486911(55-67)Online publication date: 17-Oct-2021
  • (2019)LXDsProceedings of the 2019 USENIX Conference on Usenix Annual Technical Conference10.5555/3358807.3358831(269-284)Online publication date: 10-Jul-2019
  • (2016)Lightweight Capability DomainsACM SIGOPS Operating Systems Review10.1145/2883591.288360149:2(44-50)Online publication date: 20-Jan-2016
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

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
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: 22 October 2011
Published in SIGPLAN Volume 46, Issue 10

Check for updates

Author Tags

  1. asynchronous IO
  2. barrelfish
  3. message passing

Qualifiers

  • Research-article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)5
  • Downloads (Last 6 weeks)0
Reflects downloads up to 08 Feb 2025

Other Metrics

Citations

Cited By

View all
  • (2021)A concurrency model for JavaScript with cooperative cancellationProceedings of the 14th ACM SIGPLAN International Conference on Software Language Engineering10.1145/3486608.3486911(55-67)Online publication date: 17-Oct-2021
  • (2019)LXDsProceedings of the 2019 USENIX Conference on Usenix Annual Technical Conference10.5555/3358807.3358831(269-284)Online publication date: 10-Jul-2019
  • (2016)Lightweight Capability DomainsACM SIGOPS Operating Systems Review10.1145/2883591.288360149:2(44-50)Online publication date: 20-Jan-2016
  • (2016)Programming with event loops and control loops - From actors to agentsComputer Languages, Systems and Structures10.1016/j.cl.2015.12.00345:C(80-104)Online publication date: 1-Apr-2016
  • (2015)Lightweight capability domainsProceedings of the 8th Workshop on Programming Languages and Operating Systems10.1145/2818302.2818307(8-14)Online publication date: 4-Oct-2015
  • (2014)Afluentes Concurrent I/O Made Easy with Lazy EvaluationProceedings of the 2014 22nd Euromicro International Conference on Parallel, Distributed, and Network-Based Processing10.1109/PDP.2014.75(279-287)Online publication date: 12-Feb-2014
  • (2012)Programming abstractions for integrating autonomous and reactive behaviorsProceedings of the 2nd edition on Programming systems, languages and applications based on actors, agents, and decentralized control abstractions10.1145/2414639.2414650(83-94)Online publication date: 21-Oct-2012
  • (2023)An Efficient Scheduler for Task-Parallel Interactive ApplicationsProceedings of the 35th ACM Symposium on Parallelism in Algorithms and Architectures10.1145/3558481.3591092(27-38)Online publication date: 17-Jun-2023
  • (2019)Reaping the performance of fast NVM storage with udepotProceedings of the 17th USENIX Conference on File and Storage Technologies10.5555/3323298.3323300(1-15)Online publication date: 25-Feb-2019
  • (2018)Continuation-Passing C, compiling threads to events through continuationsHigher-Order and Symbolic Computation10.1007/s10990-012-9084-524:3(239-279)Online publication date: 13-Dec-2018
  • Show More Cited By

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media