by Cameron Hughes, Tracey Hughes
In the basic sequential model of programming, a computer program’s instructions are executed one at a time. Each task is performed in a specified order, and each task stands in line and must wait its turn.
This changes when the software requirements include multithreading or multiprocessing components. When parallel processing is called for virtually every aspect of the software design and implementation is affected. The developer is faced with what we call the ten challenges of concurrency (although the authors only have 9 in the list):
1. Software decomposition into instructions or sets of tasks that need to execute simultaneously.
2. Communication between two or more tasks that are executing in parallel.
3. Concurrently accessing or updating data by two or more instructions or tasks.
4. Identifying the relationships between concurrently executing pieces of tasks.
5. Controlling resource contention when there is a many-to-one ratio between tasks and resource.
6. Determining an optimum or acceptable number of units that need to execute in parallel.
7. Documenting and communicating a software design that contains multiprocessing and multithreading.
8. Creating a test environment that simulates the parallel processing requirements and conditions.
9. Recreating a software exception or error in order to remove a software defect.
This is an excerpt from our book “Professional Multicore Programming: Design and Implementation for C++ Developers” Chapter 3, page 36.