ABSTRACT

Multi-core processors are everywhere: high-end desktops have multiple cores. Even mobile phones also have multi-core chips. It has become difficult to make individual cores faster, but adding more cores is easier. More cores do not necessarily mean faster programs, because many factors affect a computer’s performance. The number of cores is one factor, but the software is also important. If a program does not take advantage of multiple cores, then it may as well be running on a single core processor. If a program is written for multiple cores, then the program can be referred to as a parallel program. If a program is not written for multiple cores, then it is called a sequential program. All programs so far in this book are sequential programs. This chapter provides an introduction to writing parallel programs using threads.