Ana Lúcia De Moura and Roberto Ierusalimschy. 2009. Revisiting coroutines. ACM Trans. Program. Lang. Syst. 31, 2, Article 6 (February 2009), 31 pages.

Remarkable PDF

Original PDF



This article advocates the revival of coroutines as a convenient general control abstraction. After proposing a new classification of coroutines, we introduce the concept of full asymmetric coroutines and provide a precise definition for it through an operational semantics. We then demonstrate that full coroutines have an expressive power equivalent to one-shot continuations and one-shot delimited continuations. We also show that full asymmetric coroutines and one-shot delimited continuations have many similarities, and therefore present comparable benefits. Nevertheless, coroutines are easier implemented and understood, especially in the realm of procedural languages.

Languages » Lua


author = {Moura, Ana L\'{u}cia De and Ierusalimschy, Roberto},
title = {Revisiting coroutines},
year = {2009},
issue_date = {February 2009},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
volume = {31},
number = {2},
issn = {0164-0925},
url = {https://doi.org/10.1145/1462166.1462167},
doi = {10.1145/1462166.1462167},
journal = {ACM Trans. Program. Lang. Syst.},
month = {feb},
articleno = {6},
numpages = {31},
keywords = {multitasking, generators, Continuations}