Coroutine与事件驱动编程
关于维基百科中的示例:
http://en.wikipedia.org/wiki/Coroutine
var q := new queue
coroutine produce
loop
while q is not full
create some new items
add the items to q
yield to consume
coroutine consume
loop
while q is not empty
remove some items from q
use the items
yield
我只是想知道基于传统事件的方法可以处理这种使用模式,为什么需要使用协同程序?
没有找到相关结果
已邀请:
1 个回复
凄嘛姥