“It’s cool to say you have a dual-core machine, but in the grand scheme of things, having it doesn’t make much difference in performance. If, however, your software can share the computational burden across your collection of processor cores, it’s a different kettle of fish. Then you actually get more work done in a given amount of time. The technique is called thread-level parallelism, more commonly known as threading, and it requires some mental adjustment on the part of the developer.”
A Brief Programmer’s Guide to Multi-Core Development
Submitted by estherschindler 2006-01-31 General Development 10 Comments
> You also have to make sure that the threads aren’t stomping on each other’s data
> (avoid global variables, Reinders says), and that communication between them
> is disciplined. In some ways, it’s like the old days of DOS programming; you have to
> pay careful attention that threads aren’t intruding on each other’s memory space, or
> if they share, that the appropriate locks and other checks are in place. Otherwise,
> you could set up race conditions, or create deadlocks if each thread thinks it
> is waiting for the other.
At least the article tells us about the dangers of threading. However, just using “disciplined comunication” and nothing else will be the death blow for performance, not to mention the inevitable zoo of bugs to be introduced due to overlooked race conditions. The article never mentions the key to high performance by threading, namely the required lack of data dependencies between the different threads.
I thought it was an empty commercial stating the obvious. Use threads so the multi processor machine can run in parallel. Use inter-process communication so they don’t trash each other. Don’t use global data. Look both ways when crossing the street. Don’t run with scissors. Stay out of the rain.
You can easily avoid all problems mentioned by simply designing the program before you code.
How many people run two or more applications at the same time? There’s your benefit to dual-core.
I’m not saying multi-threaded apps are useless, but the blurb makes it out to seem like they’re a necessity.