Is concurrency hard?
Wed Nov 2 18:00:32 CET 2005
Mats Cronqvist wrote:
> joe's point (that reality is to all intents and purposes concurrent)
> is of course perfectly true.
> i believe the only reason concurrency is percieved as hard is
> cultural; programmers are trained to think sequentially. this in turn is
> because C++ is glorified C, C is glorified assembly, and assembly is
> sequential because CPU's are.
The CPUs for which C was designed were sequential [*]. CPUs now are highly
concurrent beasts, that use all kinds of complicated tricks to attempt to
present a sequential façade to most programs.
> so no, concurrency isn't hard. what's hard is to unlearn the habit of
> turning everything into a sequential problem.
That's one issue. There is also "artificial" difficulty introduced by the
programming model, beyond any inherent difficulty in the problem or in
understanding the problem. To be slightly contrary given the previous
answers, I think there is still significant artificial difficulty introduced
by message passing concurrency models supported in current languages,
including Erlang, although it's much less than for shared state models.
[*] although the techniques of out-of-order and speculative execution go way back,
at least to IBM's Stretch: <http://www.cs.clemson.edu/~mark/stretch.html>
David Hopwood <david.nospam.hopwood@REDACTED>
More information about the erlang-questions