Ruby

Posted by Daniel Lyons Fri, 27 Apr 2007 17:02:00 GMT

Let’s talk about things you never want to hear a language implementor say.

“Koichi decided to use native thread for YARV. I honor his decision. Only regret I have is we couldn’t have continuation support that used our green thread internal structure.” —Matz

Oh, great! We get native threads finally!

“It doesn’t mean that every Ruby thread runs in parallel. YARV has global VM lock (global interpreter lock) which only one running Ruby thread has.” —Koichi

So picture this if you can. I make 100 threads, each one doing some independent task. On Ruby 1.8 and below, each of those “threads” is really just an execution context that the language manages for me. Only one runs at a time and they only use one of my processors.

Well, we all hate green threads! So under Ruby 1.9 and above, if you make 100 threads, you get 100 threads in your OS. Each one running, potentially, on a different processor. But only one running at any given time!

And there are people who aren’t willing to use Haskell because STM is “immature?” This is fucking ridiculous.

“Parallel computing with Ruby is one of my main concern. There are some way to do it, but running Ruby threads in parallel (without Giant VM Lock) on a process is too difficult to support current C extension libraries because of their synchronization problems.” —Koichi

Tags ,  | no comments

Comments

(leave url/email »)

   Comment Markup Help Preview comment