Pause 'n' play: formalizing asynchronous C#

  • Authors:
  • Gavin Bierman;Claudio Russo;Geoffrey Mainland;Erik Meijer;Mads Torgersen

  • Affiliations:
  • Microsoft Research, UK;Microsoft Research, UK;Microsoft Research, UK;Microsoft Corp. and TU Delft, The Netherlands;Microsoft Corporation

  • Venue:
  • ECOOP'12 Proceedings of the 26th European conference on Object-Oriented Programming
  • Year:
  • 2012

Quantified Score

Hi-index 0.00

Visualization

Abstract

Writing applications that connect to external services and yet remain responsive and resource conscious is a difficult task. With the rise of web programming this has become a common problem. The solution lies in using asynchronous operations that separate issuing a request from waiting for its completion. However, doing so in common object-oriented languages is difficult and error prone. Asynchronous operations rely on callbacks, forcing the programmer to cede control. This inversion of control-flow impedes the use of structured control constructs, the staple of sequential code. In this paper, we describe the language support for asynchronous programming in the upcoming version of C$^\sharp$. The feature enables asynchronous programming using structured control constructs. Our main contribution is a precise mathematical description that is abstract (avoiding descriptions of compiler-generated state machines) and yet sufficiently concrete to allow important implementation properties to be identified and proved correct.