Thread management – the essential pthread APIs

In this—the second major portion of this first chapter on multithreadingwe shall now focus on the mechanics: using the pthreads API, how exactly does the programmer create and manage threads in an effective fashion? We will explore the essential pthreads API interfaces to fulfill this key purpose; this knowledge is the building block for writing functional and performance-friendly pthreads applications.

We will take you through the thread life cycle in terms of API sets—creating, terminating, joining upon (waiting for), and in general, managing the threads of a process. We will also cover thread stack management.

This, of course, implies that we have a pthreads runtime library installed on the ...

Get Hands-On System Programming with Linux 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.