Is it possible to disable YARV's global interpreter lock?

1.1k Views Asked by At

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?

2

There are 2 best solutions below

2
On

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.

0
On

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