Nothing Special   »   [go: up one dir, main page]

skip to main content
10.1145/1244381.1244403acmconferencesArticle/Chapter ViewAbstractPublication PagespepmConference Proceedingsconference-collections
Article

Tasks: language support for event-driven programming

Published: 15 January 2007 Publication History

Abstract

The event-driven programming style is pervasive as an efficient method for interacting with the environment. Unfortunately, the event-driven style severely complicates program maintenance and understanding, as it requires each logical flow of control to be fragmented across multiple independent callbacks.
We propose tasks as a new programming model for organizing event-driven programs. Tasks are a variant of cooperative multi-threading and allow each logical control flow to be modularized in the traditional manner, including usage of standard control mechanisms like procedures and exceptions. At the same time, by using method annotations, task-based programs can be automatically and modularly translated into efficient event-based code, using a form of continuation passing style (CPS) translation. A linkable scheduler architecture permits tasks to be used in many different contexts.
We have instantiated our model as a backward-compatible extension to Java, called TaskJava. We illustrate the benefits of our language through a formalization in an extension to Featherweight Java, and through a case study based on an open-source web server.

References

[1]
A. Adya, J. Howell, M. Theimer, W. J. Bolosky, and J. R. Douceur. Cooperative task management without manual stack management. In Proc. Usenix Tech. Conf., 2002.
[2]
A. Appel. Compiling with continuations. Cambridge University Press, 1991.
[3]
Enterprise Java Beans, http://java.sun.com/products/ejb/.
[4]
David Bond. Fizmez web server. http://sourceforge.net/projects/fizmezwebserver.
[5]
R. Engelschall. Portable multithreading - the signal stack trick for user-space thread creation. In Proc. USENIX Tech. Conf., June 2000.
[6]
J. Fischer, R. Majumdar, and T. Millstein. Preventing lost messages in event-driven programming, January 2006. http://www.cs.ucla.edu/tech-report/2006-reports/060001.pdf.
[7]
S. Ganz, D. Friedman, and M. Wand. Trampolined style. In ICFP '99, pages 18--27, 1999.
[8]
D. Gay, P. Levis, R. von Behren, M. Welsh, E. Brewer, and D. Culler. The nesC Language: A Holistic Approach to Network Embedded Systems. In PLDI '03, pages 1--11, June 2003.
[9]
P. Graunke, S. Krishnamurthi, S. Van Der Hoeven, and M. Felleisen. Programming the web with high-level programming languages. LNCS, 2028:122--137, 2001.
[10]
J. Hill, R. Szewczyk, A. Woo, S. Hollar, D. Culler, and K. Pister. System architecture directions for networked sensors. In ASPLOS '00, pages 93--104. ACM, 2000.
[11]
A. Igarashi, B. Pierce, and P. Wadler. Featherweight java: a minimal core calculus for java and gj. ACM Trans. Program. Lang. Syst., 23(3):396--450, 2001.
[12]
M. Krohn, E. Kohler, F. Kaashoek, and D. Mazieres. The Tame event-driven framework. http://www.okws.org/doku.php?id=okws:tame.
[13]
P. Li and S. Zdancewic. Advanced control flow in java card programming. In LCTES '04, pages 165--174. ACM Press, 2004.
[14]
J. Matthews, R. Findler, P. Graunke, S. Krishnamurthi, and M. Felleisen. Automatically restructuring programs for the web. Automated Software Eng., 11(4):337--364, October 2004.
[15]
N. Nystrom, M. R. Clarkson, and A. C. Myers. Polyglot: An extensible compiler framework for java. In CC '03, LNCS 2622, pages 138--152. Springer, 2003.
[16]
V. S. Pai, P. Druschel, and W. Zwaenepoel. Flash: An efficient and portable web server. In Proc. USENIX Tech. Conf., pages 199--212. Usenix, 1999.
[17]
G. Pettyjohn, J. Clements, J. Marshall, S. Krishnamurthi, and M. Felleisen. Continuations from generalized stack inspection. In ICFP '05, pages 216--227, 2005.
[18]
C. Queinnec. Inverting back the inversion of control or, continuations versus page-centric programming. SIGPLAN Not., 38(2):57--64, 2003.
[19]
J. Reppy. Cml: A higher concurrent language. In PLDI '91, pages 293--305, New York, NY, USA, 1991. ACM Press.
[20]
R. von Behren, J. Condit, and E. Brewer. Why events are a bad idea (for high-concurrency servers). In HotOS IX, 2003.
[21]
R. von Behren, J. Condit, F. Zhou, G. Necula, and E. Brewer. Capriccio: scalable threads for internet services. In SOSP '03, pages 268--281. ACM, 2003.
[22]
M. Welsh, D. Culler, and E. Brewer. SEDA: An architecture for well-conditioned, scalable Internet services. In SOSP '01. ACM, 2001.

Cited By

View all
  • (2023)UWOmppro: UWOmp++ with Point-to-Point Synchronization, Reduction and SchedulesProceedings of the 32nd International Conference on Parallel Architectures and Compilation Techniques10.1109/PACT58117.2023.00011(27-38)Online publication date: 21-Oct-2023
  • (2023)Metric Suite for Event-Driven Software Systems2023 International Conference on Advances in Computation, Communication and Information Technology (ICAICCIT)10.1109/ICAICCIT60255.2023.10466151(1140-1145)Online publication date: 23-Nov-2023
  • (2023)Models of Embedded SystemsEmbedded and Real-Time Operating Systems10.1007/978-3-031-28701-5_4(99-114)Online publication date: 15-Sep-2023
  • Show More Cited By

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image ACM Conferences
PEPM '07: Proceedings of the 2007 ACM SIGPLAN symposium on Partial evaluation and semantics-based program manipulation
January 2007
180 pages
ISBN:9781595936202
DOI:10.1145/1244381
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]

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 15 January 2007

Permissions

Request permissions for this article.

Check for updates

Qualifiers

  • Article

Conference

PEPM07
Sponsor:

Acceptance Rates

Overall Acceptance Rate 66 of 120 submissions, 55%

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)17
  • Downloads (Last 6 weeks)0
Reflects downloads up to 26 Jan 2025

Other Metrics

Citations

Cited By

View all
  • (2023)UWOmppro: UWOmp++ with Point-to-Point Synchronization, Reduction and SchedulesProceedings of the 32nd International Conference on Parallel Architectures and Compilation Techniques10.1109/PACT58117.2023.00011(27-38)Online publication date: 21-Oct-2023
  • (2023)Metric Suite for Event-Driven Software Systems2023 International Conference on Advances in Computation, Communication and Information Technology (ICAICCIT)10.1109/ICAICCIT60255.2023.10466151(1140-1145)Online publication date: 23-Nov-2023
  • (2023)Models of Embedded SystemsEmbedded and Real-Time Operating Systems10.1007/978-3-031-28701-5_4(99-114)Online publication date: 15-Sep-2023
  • (2020)Testing Event-Driven Programs in ProcessingProceedings of the 2020 European Symposium on Software Engineering10.1145/3393822.3432338(6-11)Online publication date: 6-Nov-2020
  • (2019)SLEDS: A DSL for Data-Centric Storage on Wireless Sensor NetworksBig Social Data and Urban Computing10.1007/978-3-030-11238-7_5(74-89)Online publication date: 23-Jan-2019
  • (2018)Distributed system development with ScalaLociProceedings of the ACM on Programming Languages10.1145/32764992:OOPSLA(1-30)Online publication date: 24-Oct-2018
  • (2018)Balancing parallelization and asynchronization in event‐driven programs with OpenMPConcurrency and Computation: Practice and Experience10.1002/cpe.495931:4Online publication date: 21-Sep-2018
  • (2016)Multitier reactive abstractionsCompanion Proceedings of the 2016 ACM SIGPLAN International Conference on Systems, Programming, Languages and Applications: Software for Humanity10.1145/2984043.2984051(18-20)Online publication date: 20-Oct-2016
  • (2016)A type-and-effect system for asynchronous, typed eventsProceedings of the 15th International Conference on Modularity10.1145/2889443.2889446(42-53)Online publication date: 14-Mar-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
  • 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