From: Charles Oliver Nutter Date: 2008-07-31T04:22:29+09:00 Subject: Re: Concurrent Ruby? Tony Arcieri wrote: > On Mon, Jul 28, 2008 at 10:17 PM, Kyle Murphy wrote: > >> Apologies if this is a really stupid question, I am new to programming, >> but after reading about Erlang and it's speed increase on multi-core >> devices I had to ask. >> >> With Matz supposedly making Ruby 2.0 right now, is it possible to make >> it concurrent like Erlang so as to take advantage of the future >> multi-core devices? Thank you. >> > > Rubinius is able to spawn a VM per CPU core, and allow quasi-Erlang style > concurrency using Actor objects which can communicate across inter-VM > message buses. > > It's not as elegant as Erlang's SMP scheduler (something like that really > isn't possible without a shared-nothing process architecture), but it more > or less provides the same approach Erlang uses for distributed systems (i.e. > each CPU is a "node") It's worth mentioning JRuby also supports the MVM API, and sub-VMs share nothing with their parents save them message queue. Sub-VMs also are launched in their own native thread (though of course JRuby has native threads within a given VM as well). It wouldn't be much of a leap to implement the Actor model as well. - Charlie