Fundamental Parallelism
Recently published on Embedded.com is a two part article on the subject of parallel programming. Written by two Intel engineers, Part 1 gives a good introduction to the subject and describes the various architectural approaches to parallelism using analogies which make the concepts easy to understand. Part 2 shows how an algorithm, which might appear to be difficult to do so, can be architected as a parallel process.
What I find not discussed sufficiently in this article are the challenging issues related to having multiple processors vying for access to the same resources simultaneously. For instance, they don't discuss, or even mention, what an atomic operation is. Wikipedia gives a good scientific definition of an atomic operation, but from the implementer's viewpoint, what's important is knowing which operations will complete without interruption or possible data corruption.
What is and is not atomic is dependent on the processor and, on a multi-core system, the bus design. For example, a memory read operation that requires two bus accesses might be interrupted (i.e. be non-atomic) on a shared bus. If this sounds like it would be difficult to research and know for sure, well, it is and is likely to change based on hardware implementation. So as a software implementer, assume that you can't write any code that’s atomic. If your data will be accessed by more than one thread, you must use a synchronization mechanism. The Win32 API provides a rich set of synchronization mechanisms, and is a great start. But you also need to be aware of the possibility of a deadlock when multiple synchronization mechanisms are used.
So my point is that the Embedded.com article on parallel programming is worth the read, but if you intend to take up parallel programming for the first time, you need to delve deeper. I would suggest you look at the Wikipedia article on parallel computing, then check out the links and other resources at the bottom of the article.
-Jim
Comments
- Anonymous
June 14, 2007
PingBack from http://msdnrss.thecoderblogs.com/2007/06/14/more-parallelism/