Learning to Program POSIX and C++ Threads

In this chapter, the reader will learn how to program both POSIX and C++ threads. We will start by discussing how to program with POSIX threads, and then move on to C++ threads, providing a comparison of the APIs for each one.

Then we will present three examples. The first will demonstrate how to use threading to perform a parallel computation. The second will demonstrate how to create your own high-resolution timer using threading in order to perform benchmarking (albeit a timer that is likely not very accurate).

The third and final example will build upon our existing debugging example to provide support for multiple clients.

It should be noted that this chapter assumes the reader already has a ...

Get Hands-On System Programming with C++ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.