是否可以禁用 YARV 的全局解释器锁?

发布于 2024-09-30 16:54:22 字数 141 浏览 0 评论 0原文

这比其他任何事情都更令人好奇(我应该完全放弃它并尝试 jRuby),但是是否可以禁用 YARV ruby​​ 的全局解释器锁和任何其他关联的锁?

我认为这会“使您的保证失效”,因为一些 YARV Ruby 的库不是线程安全的,但它会导致任何其他问题吗?

This is more curiosity than anything else (I should totally drop that and try jRuby), but is it possible to disable YARV ruby's global interpreter lock and any other associated locks?

I assume this would "void your warranty" as some of YARV Ruby's libraries aren't thread safe, but would it cause any other problems?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

吻泪 2024-10-07 16:54:23

除非您实际编辑源代码并重新编译,否则无法禁用它。我还没有研究过它是如何实现的,但我猜想很难将它从代码中“弹出”。如果您不需要 GIL,您可以尝试 JRuby,我很确定 Rubinius 也没有 GIL。

There is no way to disable it unless you actually edit the source code and recompile. I haven't looked at how it's implemented, but I'm guessing it's hard to just "pop" it out of the code. If you don't want a GIL you could try JRuby, and I'm pretty sure Rubinius doesn't have one as well.

豆芽 2024-10-07 16:54:23

Tenderlove tweet 有关禁用 GIL 的补丁:

我想看看@_ko1的实验性补丁来删除GIL /cc
@yukihiro_matz #rubyconf

Tenderlove has tweeted about a patch to disable the GIL:

I’d like to see @_ko1’s experimental patch to remove the GIL /cc
@yukihiro_matz #rubyconf

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文