GPars implements much of the agent functionality found in Clojure.
GPars实现Clojure中的很多agent功能。
Actors in GPars are lightweight processes that consume messages from a mailbox.
GPars中的Actors是从邮箱中使用消息的轻量级进程。
GPars implements the actor model using many of the concepts from Erlang and Scala.
GPars使用来自Erlang和Scala的许多概念实现actor模型。
Agents are an important feature in Clojure and it's nice to see them show up in GPars.
Agents是Clojure中的一个重要特性,很高兴可以看到它们出现在GPars中。
GPars does not yet include an implementation of STM, but it likely will in the future.
然而,GPars不包括STM的实现,但是将来有可能会包括。
We've already explored the mechanics of how to push tasks into an Executor pool with GPars.
我们已经探究了如何使用GPars将任务推入Executor池的机理。
GPars provides nice implementations of all the key actor features plus some additional ones.
GPars很好地实现了所有关键actor功能以及一些额外功能。
The three approaches I'll demonstrate are actors, agents, and dataflow variables, all of which are supported by GPars.
我将要展示的三种方法是actors、agents和数据流变量,它们均受GPars支持。
Additionally, GPars extends collections inside a GParsPool block, giving us additional parallel methods built on the primitives.
另外,GPars在一个GParsPool块内扩展集合,为我们提供构建于原语之上的其他并行方法。
GPars also defines logical dataflow tasks that are scheduled over a thread pool (like actors) and communicate via dataflow variables.
GPars还定义通过线程池(比如actors)调度的逻辑数据流任务并通过数据流变量进行传输。
In gpars, actors can be created from a factory method that takes a closure or by subclassing groovyx.gpars.actor.AbstractPooledActor.
在gpars中,可以利用接受闭包的factory方法或通过为groovyx . gpars . actor . AbstractPooledActor划分子类来创建actors。
Because GPars gives these tasks to a pool of workers, I can now perform all of my searches in parallel (provided the pool is large enough).
由于GPars将这些任务分配给了一批作业员,我现在可以并行执行我的所有搜索了(只要内存池足够大)。
The GPars Executors DSL makes it easy to transform the program in Listing 1 from serial processing to parallel processing, as shown in Listing 2
GParsExecutorsDSL使得我们更容易将清单1中的程序从串行处理转换为并行处理,如清单 2 所示
Listing 9 contains a complete representation of the "Rock, Paper, Scissors" game implemented with GPars using a Coordinator actor and two Player actors.
清单9含有对 “Rock,Paper,Scissors”游戏的完整表示,该游戏是通过GPars使用一个Coordinatoractor和两个 Playeractors 实现的。
The GPars implementation is missing some features (like modification actions and watchers), but these are minor omissions and will likely be added in the future.
GPars实现在失去一些功能(比如修改操作和观察程序),但这些只是微小遗漏,将来可能会予以添加。
The GPars implementation is missing some features (like modification actions and watchers), but these are minor omissions and will likely be added in the future.
GPars实现在失去一些功能(比如修改操作和观察程序),但这些只是微小遗漏,将来可能会予以添加。
应用推荐