Native threads in Ruby 1.9.1, whats in it for me?

concurrency, ruby

Solution

I think the big win, is that C based extensions can release the GIL. So, for example, a MySQL adapter can quite cleanly run long running database queries without blocking up all the other Ruby threads.

Problem

So, Ruby 1.9.1 is now declared stable. Rails is supposed to work with it and slowly gems are being ported to it. It has native threads and a global interpreter lock (GIL). Since a GIL is in place, do native threads offer any kind of benefit over green threads in 1.9.1?

Original source