coroutine 英[kəru:'ti:n] 美[kəru:'ti:n]
n. 协同程序;
[网络] 协同常式; 协同例程; 联立程序;
[例句]The thing to notice about this wrapper is that each generator/ coroutine yields a tuple that contains its intended branch destination.
关于这个包装器要注意的一点是,每个生成器/协同程序都会生成一个包含它的预期分支目标的元组。
[其他] 形近词: microroutine superroutine macroroutine
coroutine基础
Lua所支持的协程全称被称作协同式多线程(collaborative multithreading)。Lua为每个coroutine提供一个独立的运行线路。然而和多线程不同的地方就是,coroutine只有在显式调用yield函数后才被挂起,同一时间内只有一个协程正在运行。
Lua将它的协程函数都放进了coroutine这个表里,其中主要的函数如下
http://www.zhihu.com/question/21483863
详细看上面网址。
满意请采纳,谢谢!