English 中文(简体)
鲁比夫是否同时?
原标题:Can Ruby Fibers be Concurrent?

我试图在我的节目中加快一些速度,我已听说,Rubys比read快,能够利用多个核心。 我仔细研究,但我只能找到如何同时管理不同的想法。 read:

threads = []

threads << Thread.new {Do something}
threads << Thread.new {Do something}

threads.each {|thread| thread.join}

我看不出如何用手法做这样的事情。 我可以找到的是<条码>yield和resume,这似乎只是一种在三者之间开端和停步的堡垒。 是否有办法真正同意这些想法?

最佳回答

页: 1 http://www.un.org/Depts/DGACM/index_chinese.htm 这份<全程<><>条码>:<>无>>>> 代码:never同时运行,它们是合作性的,是决定性的。 <代码>Fibers are coroutines. (事实上,我从来不理解为什么它们只是被称作<条码>。) Coroutine s.

鲁比的唯一一致概念是Thread

问题回答

似乎有一种术语问题,即一致性和平行性。

我也找不到如何同时管理不同的想法。

我认为,你实际上谈论的是平行主义,而不是同意:

www.un.org/spanish/ga/president 这必然意味着两人均一时空投。 例如,在单记分机上乘飞机。 <>Parallelism> 是实际同时执行的任务,例如涉及多个核心进程的任务。

引言: 1. 证券与平行主义 差别是什么?

Also well illustrated here: http://concur.rspace.googlecode.com/hg/talk/concur.html#title-slide

回答问题:

纤维是用于在鲁比拉执行轻权合作社的首选。

http://www.ruby-doc.org/core-2.1.1/Fiber.html

罗马尼亚

如果你想要真正同意的话,你就希望用 j子(实际上没有耳光,它只有read子,每耳光有一).)。

另一种选择是“幸运”新程序,这些新程序可能同时在多边投资倡议上运行。





相关问题
Ruby parser in Java

The project I m doing is written in Java and parsers source code files. (Java src up to now). Now I d like to enable parsing Ruby code as well. Therefore I am looking for a parser in Java that parses ...

rails collection_select vs. select

collection_select and select Rails helpers: Which one should I use? I can t see a difference in both ways. Both helpers take a collection and generates options tags inside a select tag. Is there a ...

RubyCAS-Client question: Rails

I ve installed RubyCAS-Client version 2.1.0 as a plugin within a rails app. It s working, but I d like to remove the ?ticket= in the url. Is this possible?

Ordering a hash to xml: Rails

I m building an xml document from a hash. The xml attributes need to be in order. How can this be accomplished? hash.to_xml

multiple ruby extension modules under one directory

Can sources for discrete ruby extension modules live in the same directory, controlled by the same extconf.rb script? Background: I ve a project with two extension modules, foo.so and bar.so which ...

Text Editor for Ruby-on-Rails

guys which text editor is good for Rubyonrails? i m using Windows and i was using E-Texteditor but its not free n its expired now can anyone plese tell me any free texteditor? n which one is best an ...

热门标签