协程与子例程一样,协程(coroutine)也是一种程序组件。相对子例程而言,协程更为一般和灵活,但在实践中使用没有子例程那样广泛。协程源自 Simula 和 Modula-2 语言,但也有其他语言支持。
其亮点在于其设计遵循小型、简单、易用的原则,同时可支持任务(tasks)和协程(co-routines)以及队列、二进制信号量、计数信号量、递归信号量和互斥量等,可用于任务之间、任务和中断之间的通信和同步。
基于6个网页-相关网页
半协程 Semi-Coroutine
音频工程协会 Audio Engineering Society ; AES
美国汽车工程师协会 SAE ; Society of Automotive Engineers ; SAE International ; AIAE
电气和电子工程师协会 IEEE ; Institute of Electrical and Electronics Engineers ; Electrical and Electronics Engineers ; Institute of Electronics Engineers
协同程序 coroutine ; symbiont ; StartCoroutine
电气工程师协会 Institution of Electrical Engineers ; AIEE ; IEE ; - institution of electrical engineers
协会章程 association charter ; Association Constitution ; articles of association ; Bylaw
结构工程师协会 Institution of Structural Engineers ; Structural Engineers Association of California ; SEAOC
课程协调人 coordinator ; statistics
传入一个动作,函数,方法或协程。
由于发电机本身实施协程API的话,那就很容易意外地使用发电机当你真正希望使用一个协同程序。
Since generators inherently implement the API for coroutines then it would be easy to accidentally use a generator when you actually expected to be using a coroutine.
我不知道是否有机会将协程纳入真正的JVM版本中,但对那些需要协程或threadlet的语言来说这点很有帮助。
I don't know if there's any chance of this getting into a real JVM release, but it would be greatly appreciated by any languages that need coroutines or threadlets.InfoQ Any big plans for 1.6?
应用推荐