

Parallelism /= Concurrency - maxtilford
http://ghcmutterings.wordpress.com/2009/10/06/parallelism-concurrency/

======
alain94040
This article has a few flaws.

First, I disagree with the definition of parallelism. So the whole argument
becomes moot to begin with.

Second, the author conveniently ignores that languages with side-effects can
also be automatically parallelized by their compiler, which achieves the same
effect as the parallelism described for functional languages. Which makes the
point of the article moot again.

In conclusion (to me at least), this article adds to the confusion rather than
offer the clarity it was aiming for.

~~~
mbrubeck
You may "disagree" with this definition, but it's one that is commonly used by
computer scientists. So it's a definition that is useful to know if you plan
on doing or studying any research in this field. For example, see section 4.3
of this paper by Peter van Roy (author of the well-known _Concepts,
Techniques, and Models of Computer Programming_ ):

<http://lambda-the-ultimate.org/node/3465>

Here's van Roy's definition:

 _"Concurrency should not be confused with parallelism. Concurrency is a
language concept and parallelism is a hardware concept. Two parts are parallel
if they execute simultaneously on multiple processors. Concurrency and
parallelism are orthogonal: it is possible to run concurrent programs on a
single processor (using preemptive scheduling and time slices) and to run
sequential programs on multiple processors (by parallelizing the
calculations)."_

And no, languages with side-effects cannot be automatically parallelized
without changing the semantics and introducing observable nondeterminism - not
nearly to the same extent as pure languages. The examples I've seen
essentially work for side-effect-free subsets, which kind of misses the point.
Your C compiler may be able to vectorize a loop of arithmetic operations, but
as soon as your code includes an external function call the compiler has know
way of knowing whether that function performs I/O or modifies global
variables, so it cannot safely make parallel calls to that function.

~~~
alain94040
_languages with side-effects cannot be automatically parallelized without
changing the semantics and introducing observable nondeterminism_

Considering I spent years working on automatic parallelizing compilers for
Fortran and C++, I'd say it is possible. I don't know why you consider the
heavily computational kernels of C programs less interesting just because they
don't have side effects or make IO calls.

For instance I worked on some algorithms to parallelize linked-list
traversals, something that you would normally think is by definition serial.

~~~
astine
Could you share the algorithm (or a link)? I'm very interested.

~~~
codexon
[http://software.intel.com/en-us/blogs/2007/12/20/linked-
list...](http://software.intel.com/en-us/blogs/2007/12/20/linked-lists-
incompatible-with-parallel-programming/)

"Traversing a linked list is inherently serial. [Theorists will point out that
traversal can be done in parallel if you have a processor per node in the
list. Feel free to buy that many Intel processors -- I own Intel stock.]"

One possible implementation would be to use a skip list where you have each
core search each level.

