HACKER Q&A
📣 metadat

Any efforts to remove the GIL for Ruby?


Have there been efforts comparable to those underway with Python to remove the GIL in Ruby?


  👤 Lio Accepted Answer ✓
In a sense the GIL (or actually GVL as it's called in current ruby versions) has already been removed for ruby.

It's only the original MRI Ruby that still has it several over Ruby implementations already removed it. e.g. JRuby.

Concurrent-Ruby[1] is probably a good place to start if you want to work with GVL free ruby on JRuby. It's quite well supported and is currently used by Rails.

If you just want async or non-blocking IO I'd take a look at the Async Gem[2]. It looks pretty solid in Ruby > 3.0 and it's been invited by Matz to be part of the stdlib, which I think is a pretty good endorsement.

For MRI itself I don't think it's likely they'll ever remove the GVL. Ractors are probably a better solution for CPU concurrency in the long run, although I think they're pretty experimental currently.

1. https://github.com/ruby-concurrency/concurrent-ruby 2. https://github.com/socketry/async


👤 weatherlite
Not sure what's happening in Python but Ractors is the current biggest effort in Ruby I'm aware of. It won't remove the GIL from all of Ruby but will remove it in the context of Ractors - so its an instrument for real multi core concurrency. Still experimental though.