Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Ruby Enterprise use Green threads?

I was wondering this and couldn't find anything except this

"Thread scheduler bug fixes and performance improvements. Threading on Ruby Enterprise Edition can be more than 10 times faster than official Ruby 1.8"

like image 661
concept47 Avatar asked Jun 09 '26 00:06

concept47


1 Answers

REE is derived from MRI 1.8.7. As such, it only used green threads. REE changes some parts of 1.8.7 (esp. in the areas memory management and garbage collection). But it still widely follows the design of the upstream MRI (the original Matz's Ruby Interpreter)

While YARV (1.9) switched to OS native threads, they still have a global interpreter lock making sure that only exactly one of these threads runs at a time.

There are a couple of Ruby implementations with OS native threads and without a GIL. The most prominent are JRuby (based on the JVM) and Rubinius (with its own VM). These implementations offer "real" concurrent threads.

like image 74
Holger Just Avatar answered Jun 10 '26 19:06

Holger Just