脚本内协同程序花费的时间。
你能叠加和连接协同程序。
对于轻便线程来说,它们的需求与协同程序的需求稍有不同。
For weightless threads, the requirements are slightly different from those for coroutines.
本专栏的前面一部分提出了一种用简单的生成器模拟协同程序的机制。
Another installment of this column presents a mechanism for simulating coroutines with simple generators.
不同之处在于,调度程序本身应该决定分支目标,而不是从生成器/协同程序接收分支目标。
The difference is that the scheduler itself should decide branch targets rather than receive them from the generator/coroutines. Let me show you a complete test program and sample
关于这个包装器要注意的一点是,每个生成器/协同程序都会生成一个包含它的预期分支目标的元组。
The thing to notice about this wrapper is that each generator/coroutine yields a tuple that contains its intended branch destination.
这些协同程序并不是真正的协同程序,因为它们只控制到scheduler函数和来自该函数的分支。
These are not true coroutines in the sense that they control only branches to and from the scheduler function.
由于发电机本身实施协程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.
你可能会奇怪,为什么一个什么样的区别异步基于协同程序和基于发电机协同程序将在各自的暂停表情接受吗?
You may be wondering why the difference between what an async-based coroutine and a generator-based coroutine will accept in their respective pausing expressions?
本文介绍了一种使用PASCAL语言进行协同程序设计的方法,这种方法是建立在现有PASCAL语言编译系统之上的。
This paper introduces a method of coroutines programming in PASCAL language. The method is based on usage existing compiler.
随着Ruby 1.9增加了纤程Fibers(协同程序),以及最近Erlang和Actors的流行,一组少为人之的概念进入了Ruby的编程世界。
With Ruby 1.9 adding Fibers (Coroutines) and the recent popularity of Erlang and Actors, a group of little known concepts entered the Ruby programming world.
随着Ruby 1.9增加了纤程Fibers(协同程序),以及最近Erlang和Actors的流行,一组少为人之的概念进入了Ruby的编程世界。
With Ruby 1.9 adding Fibers (Coroutines) and the recent popularity of Erlang and Actors, a group of little known concepts entered the Ruby programming world.
应用推荐