Ask HN: Why is concurrent programming so hard ?

https://news.ycombinator.com/item?id=768220
by jacquesm • 17 years ago
8 11 17 years ago

This is one of those things that keep coming up over and over again, compared to 'regular' programming programming concurrent (massively parallel) systems is hard.

Lots harder than the simple relation between the number of threads of execution and a single thread should make you suspect.

Unless your problem is one that is easily parallelized you are left with limited alternatives.

Usually this is put down to either architectural issues (von Neumann vs alternatives), sometimes to the difficulties of locking and such, most times to how easy a program can be parallelized.

But even the latter is an effort on the part of the programmer, rarely of the environment the program is written in (though there are some interesting developments in that area).

I have this weird theory that it has to do with something completely different:

Our brains are not wired to have 'multiple parallel threads' of consciousness.

So we have a hard time envisioning in our sequentially wired brains what is going on in a parallel program, which means we feel much more 'at home' in a sequential environment.

It takes a good bit of training to get around that limitation and even then it is not easy.

So we tend to 'break up' our programs into sequential pieces of code, each running in parallel with the rest, and the spots where they meet, like trains using a railroad track, have to be scheduled to make things execute in the proper sequence.

This makes me wonder if we are truly capable of devising a method of parallel execution that will feel 'natural'.

Even in the real world, when we 'concentrate' we single out a thread from all the possible inputs and go step-by-step to analyze that one single process.

What are your thoughts on this ?

Related Stories

Loading related stories...

Source preview

news.ycombinator.com