Chapter 3

Creating and Running Threads

Abstract

This chapter describes the basic programming interfaces for creating, running, and terminating threads in a process. The thread management programming interfaces proposed by the native libraries—Pthreads and Windows—as well as the C++11 thread library are first discussed, observing how the same universal concepts and features are implemented in somewhat similar ways. Next, a high-level, portable interface for simple thread management is introduced. This utility, included in the vath library, encapsulates the low-level interfaces previously described. Finally, a first look is given at the way threads are managed in OpenMP. All these issues are illustrated with several examples.

Keywords

Thread ...

Get Shared Memory Application Programming 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.