Chapter 5. Processes, C++ Interface Classes, and Predicates


As long as I held the Divine Spear, I had to accept debugging as my primary duty.

 --Tatsuya Hamazaki, .hack//AI Buster 2

In Chapter 4, we looked at the operating system's role as a development tool for applications that required parallel programming. We provided a brief overview of the part that the operating system plays in process management and thread management. We introduced the reader to the notion of operating system Application Program Interfaces (APIs) and System Program Interfaces (SPIs), and in particular we introduced the POSIX API. In this chapter we are going to take a closer look at:

  • Where the process fits in with C++ programming and multicore computers

  • The POSIX API for process management

  • Process scheduling and priorities

  • Building C++ interface components that can be used to simplify part of the POSIX API for process management

Basically, a program can be divided into processes and/or threads in order to achieve concurrency and take advantage of multicore processors. In this chapter, we cover how the operating system identifies processes and how an application can utilize multiple processes.

We Say Multicore, We Mean Multiprocessor

Keep in mind that the name multicore is a popular substitution for single chip multiprocessor or CMP. Multiprocessors are computers that have more than two or more CPUs or processors. Although multiprocessor computers have been around for some time now, the wide availability and low ...

Get Professional Multicore Programming: Design and Implementation for C++ Developers now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.