[erlang-questions] lists:pmap ?

Ulf Wiger <>
Wed Aug 30 13:31:48 CEST 2017


I discussed the problems with a general pmap in a presentation back in 2009.

https://www.infoq.com/presentations/wiger-multicore-erlang

The purpose wasn't really to argue against a general pmap, but rather to
use it as a simple example to illustrate the problems with treating erlang
processes as 'fibers' rather than independent actors.

BR,
Ulf W

2017-08-22 10:42 GMT+02:00 Ola Andersson A <>:

> Reading the discussion about list:mapfind reminded me of a function I
> rediscovered recently.
> It's rpc:pmap/3 that was originally defined for use in a distributed
> environment, spreading out the processing over several nodes. It actually
> works on a single multicore node as well even though it wasn't designed for
> that purpose.
> With the limited tests I have done it seems to significantly outperform
> lists:map/2 and also scale reasonably well. The almost negligible cost of
> spawning erlang processes is still amazing.
> How about adding a lists:pmap/2 function, designed for multicore, in the
> lists module?
> /OLA.
>
> _______________________________________________
> erlang-questions mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-questions
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20170830/93067753/attachment.html>


More information about the erlang-questions mailing list