Demystifying Ruby: It's all about threads (2024)
78 points
10 months ago
| 2 comments
| blog.papey.fr
| HN
josefrichter
10 months ago
[-]
I remember Jose Valim’s work on this in Ruby ~15 years ago. And then he went on to create Elixir and we never looked back.
reply
jemmyw
10 months ago
[-]
Ruby hasn't stopped either and the last few years have seen a lot of improvement in it's concurrency story. I still prefer it to Elixir, that's just personal preference rather than a weigh up.
reply
tiffanyh
10 months ago
[-]
How would you compare Ruby/Rails to Elixir/Phoenix these days, based on completeness of framework, language performance, concurrency, etc?
reply
mathgeek
10 months ago
[-]
Memories here as well! Was working in Rails full time back then and dabbled in Elixir to some very fun experiments.
reply
jemmyw
10 months ago
[-]
> This makes Ruby threads lightweight (also known as “Green Threads”)

It's a shame they got this wrong and didn't discuss threads much. Ruby threads, since 1.9, are really threads managed by the OS and are not green threads. The parallelism is limited by the goal interpreter lock, but calling out to non Ruby code may be parallel, otherwise all those libraries the author mentions wouldn't bother. That "may" is an annoying point of order though.

reply
Lio
10 months ago
[-]
Also the article side steps talking about JRuby or TruffleRuby, both of which are GVL free so threads do run in parallel there.

Really this is just a discussion of concurrency on the MRI rather than something to the Ruby language itself.

reply