From: Sam Duncan Date: 2012-07-09T15:34:11+09:00 Subject: Re: Green threads in 1.9.* ? This is a multi-part message in MIME format. --------------060207060704050905010204 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 07/09/2012 05:58 AM, Tony Arcieri wrote: > > Again, there's only one instance of BEAM, i.e. there is only one > virtual machine, however there are 8 schedulers running inside it. > These schedulers each have their own thread, however they share an > address space and contend on things like memory allocation (again, > because there's only one virtual machine with a single pool of > resources that much be shared among schedulers). > > In the past, when Erlang really did use green threads, it was > necessary to run a single Erlang VM per CPU core and use distributed > Erlang (even in a single system) to get multicore parallelism. > However, now that Erlang has an SMP scheduler, one Erlang VM can run a > scheduler thread per CPU core and affect multicore parallelism that way. > > -- > Tony Arcieri > All interesting stuff. This lead me to another interesting read elaborating on this somewhat: http://erlang.2086793.n4.nabble.com/Some-facts-about-Erlang-and-SMP-td2108770.html So that OTP R12B release was running smp mode by default - I wonder how far back the smp switch was available. I seem to remember running up rabbits on earlier releases and I guess we must've been using that option (perhaps lshift scripts did that for us?). Sorry, all, for the continued digression from 'Ruby Talk'. Sam --------------060207060704050905010204 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On 07/09/2012 05:58 AM, Tony Arcieri wrote:

Again, there's only one instance of BEAM, i.e. there is only one virtual machine, however there are 8 schedulers running inside it. These schedulers each have their own thread, however they share an address space and contend on things like memory allocation (again, because there's only one virtual machine with a single pool of resources that much be shared among schedulers).

In the past, when Erlang really did use green threads, it was necessary to run a single Erlang VM per CPU core and use distributed Erlang (even in a single system) to get multicore parallelism. However, now that Erlang has an SMP scheduler, one Erlang VM can run a scheduler thread per CPU core and affect multicore parallelism that way.

--
Tony Arcieri


All interesting stuff. This lead me to another interesting read elaborating on this somewhat: http://erlang.2086793.n4.nabble.com/Some-facts-about-Erlang-and-SMP-td2108770.html

So that OTP R12B release was running smp mode by default - I wonder how far back the smp switch was available. I seem to remember running up rabbits on earlier releases and I guess we must've been using that option (perhaps lshift scripts did that for us?). Sorry, all, for the continued digression from 'Ruby Talk'.

Sam


--------------060207060704050905010204--