My info may be dated, I haven’t kept up with developments in Ruby 3. Is the GIL not going to be a thing any more?
My info may be dated, I haven’t kept up with developments in Ruby 3. Is the GIL not going to be a thing any more?
Ruby 1.8 had green threads, 1.9 onwards has native threads, but with a GVL. And 3.2 may have N:M threads.
> Is the GIL not going to be a thing any more?
On paper it's already done in 3.0. What used to be the GVL is now one lock per Ractor. Every object belongs to a Ractor, and the Ractor lock need to be acquired to access the objects, except for mutable objects that can be shared across ractors.
So in practice if you are not spawning any more ractor than the main one the VM execute your program in, then it's technically still a global lock, but you now have (limited) ways to go around it.
Edit: as the sibling comment mentions, that’s part of what Ractor is trying to solve.