News for hackers. Stuff that matters.

winterkoninkje

Re:Parallelism /= Concurrency on Wednesday October 07, 2009 @03:34AM (#866271)
I think that rephrasing confuses the distinction. Concurrency is neither about performance nor about latency, it's about a conceptual organization to separate concerns into different flows of control. It's a particular kind of modularity, that's it. After you have this conceptual organization it's possible to co-opt it to improve latency (via time-slicing) or to improve performance (via running on multicore systems), but neither of those is the goal. Both are just consequences of combining the idea of concurrency with other ideas like multiprogramming and parallelism.

Parallelism, on the other hand, is all about improving performance by making simultaneous use of multiple resources. It's entirely different from multiprogramming or multiplexing which fake the multiplicity of resources; and it's entirely different from concurrency which assumes the availability of undifferentiated resources. There are many different strategies for parallelism, but most of them assume that the resources are not undifferentiated, and thus they're very dependent on the particular details of the hardware they're running on (unlike concurrency which doesn't care). Contrary to your "high level" vs "low level" distinction, parallelism is often an extremely high-level design choice which affects the entire program structure. It has to be if it's going to maximize resource usage throughout the life of the whole program.

The interesting thing about GHC's parallelism is that it's hardware agnostic, and so you don't need to rewrite your program to use different algorithms depending on the hardware. Because it's built into the language you may want to call it "low level" (i.e. "I don't have to think about it"), but it's actually a very high-level decision (because it has major repercussions on how the runtime system works and how the language lets you say things).

Re:Parallelism /= Concurrency on Wednesday October 07, 2009 @03:01AM (#866248)
Whatever the wording, there is a crucial difference between the two, irrespective of whether or how frequently they overlap or intersect.

There is a fundamental difference between asynchronous separation of concerns (concurrency) and multiple simultaneous use of resources (parallelism). Concurrency is a conceptual organization, whereas parallelism is a physical organization. These are orthogonal and you're free to have one, the other, neither, or both (in different ways). Just because they can interact in interesting ways does nothing to diminish their difference.

The point the OP was making is correct and well phrased, the comments here not withstanding. People who come from C land are used to dealing with threads (concurrency) as the primary means of doing anything non-serial. Some may be familiar with SPMD message-passing (parallelism), but they'll already know what's up. Unless you've programmed in Fortran or APL, are familiar with the Connection Machines, or do GPU coding, you won't have experienced SIMD (parallelism). People who've only ever used threads have an extremely impoverished view of the world of parallelism. Because they know threads==concurrency and they know threads can be used for parallelism, they assume the two are coextensive when they really are not.