chapter two

2 Sequential and parallel computing

 

In this chapter

  • You will learn the terminology on how to talk about a running program
  • You learn different approaches at the lowest layer of concurrency – physical tasks execution
  • You write your first parallel program
  • You learn the limitations of parallel computing approach

For thousands of years (well, not quite, but for a long time), developers have been writing programs using the simplest model of computation: the sequential model, which should already be familiar to the reader. The serial execution approach is at the core of sequential programming, and this will be our starting point in our introduction to concurrency to tie it to concepts the reader is familiar with.

Unfortunately, the performance of the serial execution approach has limits and now system architects are focused on increasing the system performance by executing several operations simultaneously. And in this chapter, we will introduce serial and parallel execution approaches, which lies at the lowest layer of concurrency.

2.1 Review: What is a program?

Before we start looking at execution, it would be helpful to understand what it is that is being executed and to establish the general terminology we will use in this book. Generally speaking, a program is a sequence of instructions that a computer system executes.

2.2 Sequential computations

2.2.1 Pros and cons of sequential computing

2.3 Parallel execution

2.4 Parallel computing requirements

2.4.1 Task independence

2.4.2 Hardware support

2.5 Parallel computing

2.6 Amdahl's law

2.7 Gustafson's law

2.8 Concurrency vs parallelism

2.9 Recap