直到2003年,很多最流行的编程语言,包括C语言和它的后继者,都未在语言内或其标准库中直接支持协程。这在很大程度上是受基于堆栈的子例程实现的限制。C++的Boost.Context[24]库是个例外,它是Boost C++库的一部分,它在POSIX、Mac OS X和Windows上支持多种CPU架构的上下文切换。可以在Boost.Context之上建造协程。
^Knuth, Donald Ervin. Fundamental Algorithms(PDF). The Art of Computer Programming 1 3rd. Addison-Wesley. 1997. Section 1.4.5: History and Bibliography, pp. 229 [2019-11-23]. ISBN 978-0-201-89683-1. (原始内容存档(PDF)于2019-10-21).
^call-with-current-continuation for C programmers. http://community.schemewiki.org/. [2019-11-27]. (原始内容存档于2008-12-16). If you're a C programmer then you've probably read the various introductions and tutorials on call-with-current-continuation (call/cc) and come out not much wiser about what it all really means. Here's the secret: it's setjmp/longjmp. But on no account say that to any Scheme programmers you know, it'll send them into paroxysms of rage as they tell you you don't know what you're talking about.
^Knuth, Donald Ervin. Fundamental Algorithms. The Art of Computer Programming 1 3rd. Addison-Wesley. 1997. Section 1.4.2: Coroutines, pp. 193–200. ISBN 978-0-201-89683-1.
^Perlis, Alan J. Epigrams on programming. ACM SIGPLAN Notices. September 1982, 17 (9): 7–13 [2019-11-23]. doi:10.1145/947955.1083808. (原始内容存档于1999-01-17). 6. Symmetry is a complexity reducing concept (co-routines include sub-routines); seek it everywhere
^ 6.06.1O. -J. Dahl; C. A. R. Hoare. Hierarchical Program Structures. C. A. R. Hoare (编). Structured Programming. London, UK: Academic Press. 1972: 175–220. ISBN 978-0122005503. In SIMULA, a coroutine is represented by an object of some class, co-operating by means of resume instructions with objects of the same or another class, which are named by means of reference variables. …… Thus a main program may establish a coroutine relationship with an object that it has generated, using the call/detach mechanism instead of the more symmetric resume/resume mechanism. In this case, the generated object remains subordinate to the main program, and for this reason is sometimes known as a Semicoroutine. …… Let X and Y be objects, generated by a "master program" M. Assume that M issues a call (X), thereby invoking an "active phase" of X, terminated by a detach operation in X; and then issues a call (Y), and so forth. In this way M may act as a "supervisor" sequencing a pattern of active phases of X, Y, and other objects. Each object is a "slave", which responds with an active phase each time it is called for, whereas M has the responsibility to define the large scale pattern of the entire computation. Alternatively the decision making may be "decentralised", allowing an object itself to determine its dynamic successor by a resume operation. The operation resume (Y), executed by X, combines an exit out of X (by detach) and a subsequent call (Y), thereby bypassing M. Obligation to return to M is transferred to Y.
^The Python Language Reference - Yield expressions. [2019-11-22]. (原始内容存档于2012-10-26). All of this makes generator functions quite similar to coroutines; they yield multiple times, they have more than one entry point and their execution can be suspended. The only difference is that a generator function cannot control where should the execution continue after it yields; the control is always transferred to the generator's caller.
^Watt, Stephen M. A Technique for Generic Iteration and Its Optimization(PDF). The University of Western Ontario, Department of Computer Science. [2012-08-08]. (原始内容存档(PDF)于2022-05-26). Some authors use the term iterator, and others the term generator. Some make subtle distinctions between the two.
^GNU Pth - IMPLEMENTATION NOTES. [2019-11-27]. (原始内容存档于2019-12-19). Pth is very portable because it has only one part which perhaps has to be ported to new platforms (the machine context initialization). But it is written in a way which works on mostly all Unix platforms which support makecontext(2) or at least sigstack(2) or sigaltstack(2) [see pth_mctx.c for details]. Portable multithreading: the signal stack trick for user-space thread creation(PDF). ATEC '00 Proceedings of the annual conference on USENIX Annual Technical Conference. 2000-06-18: 20–20 [2023-09-04]. (原始内容存档(PDF)于2022-01-18).
^Brian Kernighan, Dennis Ritchie. The C Programming Language, Second Edition(PDF). Prentice Hall. 1988 [2024-01-19]. (原始内容存档(PDF)于2023-03-25). The switch statement is a multi-way decision that tests whether an expression matches one of a number of constant integer values, and branches accordingly. …… Each case is labeled by one or more integer-valued constants or constant expressions. If a case matches the expression value, execution starts at that case. …… Because cases serve just as labels, after the code for one case is done, execution falls through to the next unless you take explicit action to escape. …… Case labels and default labels are used with the switch statement (Par.A.9.4). …… Labels themselves do not alter the flow of control.
^Haynes, C. T., Friedman, D. P., Wand, M. Continuations and coroutines. In Proceedings of the 1984 ACM Symposium on LISP and Functional Programming (Austin, Texas, United States, August 06–08, 1984). LFP '84. ACM, New York, NY, 293-298. [2024-01-14]. (原始内容存档于2024-01-14).
Ana Lucia de Moura; Roberto Ierusalimschy. Revisiting Coroutines(PDF). ACM Transactions on Programming Languages and Systems. 2004, 31 (2): 1–31 [2019-11-27]. doi:10.1145/1462166.1462167. (原始内容存档(PDF)于2019-05-13).