[erlang-questions] Application granularity (was: Parallel Shootout & a style question)
Ulf Wiger (TN/EAB)
Fri Sep 5 10:02:23 CEST 2008
Jay Nelson skrev:
> ... in response to a flurry of messages about automatically
> parallelizing list comprehensions ...
I for one have never suggested parallelizing list comprehensions,
but asked for a utility library that offers parallel versions
of e.g. list iterations.
Richard O'Keefe's EEP12 could perhaps be extended to also
support notation for when an LC could be done in parallel,
but it could well get really messy if not done Just Right.
Most likely, it would make it much less appealing to extend
LCs in other ways, e.g. with ideas taken from Haskell or
One thread I found about parallel LC was this:
Where you, Jay, suggested explicitly parallel LCs.
That, of course has to be weighed against the cost of introducing
a new language feature, but at least it doesn't break the
Principle of Least Surprise.
Ok, I admit that I did get carried away and sketched a version
of lists:map/2 that parallelizes if SMP is enabled.
Richard's point that LCs and the list iteration functions may
and often do contain side-effects is of course a show stopper,
as regards modifying functions like lists:map/2 and (especially
of course) lists:foreach/2 to suddenly have an undefined order of
QLC might be persuaded to enable parallel LCs, since you can
provide a list of options to go with the specification of a
More information about the erlang-questions