协程
引用

↑  Knuth, Donald Ervin.  (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）.
↑  Conway, Melvin E.  (PDF). Communications of the ACM (ACM). July 1963, 6 (7): 396–408  [2019-11-23]. ISSN 0001-0782. doi:10.1145/366663.366704. （原始内容 (PDF)存档于2022-04-06） –ACM Digital Library.
↑  . 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. . 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. . 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
1 2  O. -J. Dahl; C. A. R. Hoare. . C. A. R. Hoare  (编). . 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.
↑  .   [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.  (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.
↑  .   [2019-11-29]. （原始内容存档于2020-06-25）.
↑  .   [2019-11-24]. （原始内容存档于2013-01-20）.
↑  .   [2019-11-24]. （原始内容存档于2020-01-09）.
↑  . HLA Standard Library Manual.   [2019-11-24]. （原始内容存档于2019-04-27）.
↑  .   [2019-11-24]. （原始内容存档于2009-03-08）.
↑  .   [2019-11-24]. （原始内容存档于2020-06-13）.
↑  .   [2019-11-24]. （原始内容存档于2019-08-11）.
↑  . www.lua.org.   [2019-11-24]. （原始内容存档于2018-01-13）.
↑  .   [2019-11-24]. （原始内容存档于2019-05-29）.
↑  ] （页面存档备份，存于）
1 2  .   [2019-11-21]. （原始内容存档于2020-05-29）.
1 2  .   [2019-11-21]. （原始内容存档于2020-06-04）.
↑  . docs.python.org.   [2019-11-24]. （原始内容存档于2019-11-27）.
↑  . 2012-12-19  [2019-11-24]. （原始内容存档于2020-06-13）.
↑  McCartney, J. "Rethinking the Computer Music Programming Language: SuperCollider". Computer Music Journal, 26(4):61-68. MIT Press, 2002.
↑  Boost.Context（页面存档备份，存于）
↑  ISO/IEC 9899:1999 （页面存档备份，存于）, 2005, 7.13.2.1:2 and footnote 211
↑  .   [2023-09-04]. （原始内容存档于2023-09-04）.
↑  .   [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]. 
 (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）.
↑  .   [2019-11-21]. （原始内容存档于2019-11-15）.
↑  Portable Coroutine Library （页面存档备份，存于） - C library using POSIX/SUSv3 facilities
↑  lthread: a multicore enabled coroutine library written in C  （页面存档备份，存于） - lthread is a multicore/multithread coroutine library written in C
↑  .   [2023-08-27]. （原始内容存档于2023-08-27）. featuring symmetric coroutines as the main control flow abstraction.
↑  .   [2019-11-21]. （原始内容存档于2019-12-02）.
↑  .   [2023-08-27]. （原始内容存档于2023-11-13）.
↑  . October 21, 2019  [2018-10-16]. （原始内容存档于2018-11-29） –GitHub.
↑  .   [2023-08-27]. （原始内容存档于2023-08-27）.
↑  Simon Tatham. . 2000  [2019-11-22]. （原始内容存档于2019-11-09）.
↑  Brian Kernighan, Dennis Ritchie.  (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.
↑  . March 18, 2019  [2019-11-26]. （原始内容存档于2020-06-13） –GitHub.
↑  .   [2019-11-22]. （原始内容存档于2019-07-23）.
↑  http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/n4680.pdf （页面存档备份，存于） - Technical specification for coroutines
↑  https://en.cppreference.com/w/cpp/compiler_support#cpp20 （页面存档备份，存于） - Current compiler support for standard coroutines
↑  Wagner, Bill. . C# documentation. Microsoft. 11 November 2021  [2024-02-10]. （原始内容存档于2024-04-11） –Microsoft Learn.
↑  Wagner, Bill. . C# documentation. Microsoft. C# version 2.0. 13 February 2023  [2024-02-10]. （原始内容存档于2023-04-28） –Microsoft Learn.
↑  . go.dev.   [2022-11-28]. （原始内容存档于2024-06-27） （英语）.
↑  . go.dev.   [2022-11-28]. （原始内容存档于2022-11-27） （英语）.
↑  . go.dev.   [2022-11-28]. （原始内容存档于2024-06-26）.
↑  . go.dev.   [2024-02-10]. （原始内容存档于2021-11-22）.
↑  .   [2019-11-21]. （原始内容存档于2019-11-14）.
↑  .   [2020-10-29]. （原始内容存档于2018-12-31）. Support for generator-based coroutines is deprecated and is scheduled for removal in Python 3.10.
↑  .   [2019-11-21]. （原始内容存档于2019-01-05）.
↑  .   [2019-11-21]. （原始内容存档于2019-11-28）.
↑  .   [2019-11-21]. （原始内容存档于2019-11-15）.
↑  .   [2019-11-21]. （原始内容存档于2019-08-25）.
↑  .   [2020-10-02]. （原始内容存档于2020-09-16）.
↑  .   [2019-11-21]. （原始内容存档于2015-12-08）.
↑  .   [2013-06-01]. （原始内容存档于2013-06-01）.
↑  Haynes, C. T., Friedman, D. P., Wand, M. . 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）.