其他分享
首页 > 其他分享> > Coroutine 协程

Coroutine 协程

作者:互联网

https://en.wikipedia.org/wiki/Coroutine

Coroutines are computer program components that generalize subroutines for non-preemptive multitasking, by allowing execution to be suspended and resumed. Coroutines are well-suited for implementing familiar program components such as cooperative tasks, exceptions, event loops, iterators, infinite lists and pipes.

According to Donald Knuth, Melvin Conway coined the term coroutine in 1958 when he applied it to construction of an assembly program.[1] The first published explanation of the coroutine appeared later, in 1963.[2]

协程是计算机程序的一类组件,推广了协作式多任务子程序,允许执行被挂起与被恢复。相对子例程而言,协程更为一般和灵活,但在实践中使用没有子例程那样广泛。协程源自SimulaModula-2语言,但也有其他语言支持。协程更适合于用来实现彼此熟悉的程序组件,如协作式多任务异常处理事件循环迭代器无限列表管道

根据高德纳的说法, 马尔文·康威于1958年发明了术语coroutine并用于构建汇编程序[1] [2] 协程最初在1963年被提出。[2]

 

Implementations for C#

C# 5.0 includes await syntax support. 

 

标签:协程,iterator,coroutine,C#,Coroutine,coroutines,provides
来源: https://www.cnblogs.com/chucklu/p/11541638.html