On some systems, the execution of subtasks will be interleaved on a single processor on others, they can run in parallel. If we can get the computer to execute some of these subtasks at the same time, with no change in our program’s results, our overall task will continue to get as much processing as it needs, but it will complete in a shorter period of time. For instance, if our program is a marine navigation system, we could launch separate tasks to perform each sounding and maintain other tasks that calculate relative depth, correlate coordinates with depth measurements, and display charts on a screen. Today, it’s frequently useful to look at our program (our very big task) as a collection of subtasks. One of those capabilities is a computing system’s ability to perform multitasking. If all of our programs run like this, we’re very likely not using our computer to its fullest capabilities.
When we package our work according to the traditional, serial notion of a program, we’re asking the computer to execute it close to the humble performance of a computer of yesterday. Today’s computers can do many things at once (or very effectively make us believe so). Since then, computers have become more and more powerful and grown more efficient at performing the work that makes running our programs possible. Not too many years ago, single instructions were how we delivered work to computers. But we have one way into our program, regardless of its spins and hops, and one way out. If programming instructions were squares on a game board, we can see that our program has places where we stall, squares that we cross again and again, and spots we don’t cross at all. Our notion of a program can include certain eccentricities, like loops and jumps, that make a program more resemble a game of Chutes and Ladders than a piano roll. When describing how computers work to someone new to PCs, it’s often easiest to haul out the old notion that a program is a very large collection of instructions that are performed from beginning to end. Specifying Potential Parallelism in a Concurrent Programming Environment