Also known as Coroutines
Coroutines are computer program components that allow execution to be suspended and resumed, generalizing subroutines for cooperative multitasking. Coroutines are well-suited for implementing familiar program components such as cooperative tasks, exceptions, event loops, iterators, infinite lists and pipes.
Article · 中文
协程(英語:coroutine)是计算机程序的一类组件,推广了协作式多任务的子例程,允许执行被挂起与被恢复。相对子例程而言,协程更为一般和灵活,但在实践中使用没有子例程那样广泛。协程更适合于用来实现彼此熟悉的程序组件,如协作式多任务、异常处理、事件循环、迭代器、无限列表和管道。 根据高德纳的说法,马尔文·康威于1958年发明了术语“coroutine”并用于构建汇编程序 ,关于协程的最初解说在1963年发表。
Abstract from DBpedia / Wikipedia · CC BY-SA