[erlang-questions] Tilera 64-core chip - let's help them help us!
Fri Sep 7 10:39:15 CEST 2007
On 6 Sep 2007, at 23:51, Hugh Perkins wrote:
> On 9/7/07, Sean Hinde <sean.hinde@REDACTED> wrote:
>> You don't need to care about how many cores you have to make a
>> parallel map function in erlang, you only need to care about cores
>> when you start the emulator.
> Well... this will spawn a process for every item in the map. How
> efficient would that be if there are, say, 10 million elements in the
> map and only 64 processor cores?
If your problem domain really produces Erlang lists with 10 million
elements, and you want to run a map, you could sensibly change the
algorithm to manage pool of erlang processes and handle the list in
chunks. Mostly so you don't run out of memory.
In a more realistic case, with say 1000 elements in the list there is
no significant penalty to spawning 1000 erlang processes over 64
cores instead of 64 erlang processes. The erlang scheduler will
distribute the load among its pool of OS threads.
It might actually be more efficient, because the VM will have a
chance to spread more load to CPUs (OS threads) that are less busy.
More information about the erlang-questions