首页 > 其他 > 详细

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

时间:2017-10-28 13:21:27      阅读:385      评论:0      收藏:0      [点我收藏+]

 

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方式转移执行权的协程之间不是调用者与被调用者的关系,而是彼此对称、平等的

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!