码迷,mamicode.com
首页 > 其他好文 > 详细

yield方式转移执行权的协程之间不是调用者与被调用者的关系,而是彼此对称、平等的

时间:2017-10-28 13:48:47      阅读:215      评论:0      收藏:0      [点我收藏+]

标签:com   put   sum   new   point   sts   oca   int   direct   

 

zh.wikipedia.org/wiki/协程

子例程一样,协程也是一种程序组件。相对子例程而言,协程更为一般和灵活,但在实践中使用没有子例程那样广泛。协程源自SimulaModula-2语言,但也有其他语言支持。协程更适合于用来实现彼此熟悉的程序组件,如合作式多任务迭代器无限列表管道

en.wikipedia.org/wiki/Coroutine

Coroutines are computer-program components that generalize subroutines for non-preemptive multitasking, by allowing multiple entry points for suspending and resuming execution at certain locations. Coroutines are well-suited for implementing familiar program components such as cooperative tasks, exceptions, event loops, iterators, infinite lists and pipes.

Subroutines are special cases of ... coroutines.

 

yield方式转移执行权的协程之间不是调用者与被调用者的关系,而是彼此对称、平等的

标签:com   put   sum   new   point   sts   oca   int   direct   

原文地址:http://www.cnblogs.com/yuanjiangw/p/7746527.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!