简体   繁体   English

jRuby和Rubinius支持并行计算,但是不支持并行计算的gem呢?

[英]jRuby and Rubinius support parallel computing, but what about gems that don't support this?

What I'm trying to understand is, practically speaking, how much benefit do I get from the parallel computing support in jRuby / Rubinius? 实际上,我想了解的是,从jRuby / Rubinius中的并行计算支持中可以获得多少好处? A lot of ruby libraries keep track of global internal state. 许多红宝石库都跟踪全球内部状态。 Is there any way to deal with these libraries, or do they just become unusable if I decide to parallelize my Ruby script? 有什么方法可以处理这些库,或者如果我决定并行化Ruby脚本,它们是否变得不可用? Maybe Rubinius automatically puts a mutex in front of all usage of unsafe libraries? 也许Rubinius会自动在所有不安全的库使用之前放置一个互斥锁?

Whenever you want to use jruby or rubinius, you'll be forced to use gems that are compatible. 每当您要使用jruby或rubinius时,都将被迫使用兼容的宝石。
Many gems has been implemented using C extensions and you can not use them along jruby eg 许多gem已使用C扩展实现,您不能将它们与jruby一起使用,例如
Regarding others, mostly they clearly states their thread safety status. 关于其他线程,大多数情况下,它们都清楚地说明了线程安全状态。

So choosing jruby or rubinius will narrow down your options regarding the gems. 因此,选择jruby或rubinius将缩小您对宝石的选择范围。 but a huge opportunity will be exposed, you'd be able to use many mature Java Libraries(in jruby case). 但是将会暴露出巨大的机会,您将能够使用许多成熟的Java库(在jruby的情况下)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM