C Interfaces and Implementations: Techniques for Creating Reusable Software
by David R. Hanson - Princeton University
Chapter 20. Threads
The typical C program is a sequential, or single-threaded, program. That is, there is one locus of control in the program. A program’s location counter gives the address of each instruction as it is executed. Most of the time, the location is advanced sequentially, one instruction at a time. Occasionally, a jump or call instruction causes the location counter to change to the jump destination or to the address of the function called. The values of the location counter trace out a path through the program that describes its execution, and this path looks like a thread through the program.
A concurrent or multithreaded program has more than one thread, and, in the most general case, these threads are all executing at the same ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access