𝔖 Scriptorium
✦   LIBER   ✦

πŸ“

Pthreads Programming: A POSIX Standard for Better Multiprocessing

✍ Scribed by Bradford Nichols, Dick Buttlar, Jacqueline Proulx Farrell


Publisher
O'Reilly Media
Year
1996
Tongue
English
Leaves
195
Series
O'Reilly Nutshell
Edition
1
Category
Library

⬇  Acquire This Volume

No coin nor oath required. For personal study only.

✦ Synopsis


POSIX threads, or pthreads, allow multiple tasks to run concurrently within the same program. They can share a single CPU as processes do, or take advantage of multiple CPUs when available. In either case, they provide a clean way to divide the tasks of a program while sharing data. This book thoroughly covers the POSIX threads standard, which is supported by the Distributed Computer Environment (DCE), as well as Solaris, OSF/1, AIX, and several other UNIX-based operating systems. In this book you will learn not only what the pthread calls are, but when it is a good idea to use threads and how to make them efficient (which is the whole reason for using threads in the first place). The authors delves into performance issues, comparing threads to processes, contrasting kernel threads to user threads, and showing how to measure speed. He also clearly describes all the advanced features and how threads interact with the rest of the UNIX system.

✦ Table of Contents


Pthreads Programming......Page 1
Table of Contents......Page 2
Preface......Page 5
Example Programs......Page 7
Typographical Conventions......Page 8
Acknowledgments......Page 9
Appendix B - Pthreads Draft 4 vs. the Final Standard......Page 0
Overview......Page 10
What Are Pthreads?......Page 13
Potential Parallelism......Page 14
Specifying Potential Parallelism in a Concurrent Programming Environment......Page 16
Parallel vs. Concurrent Programming......Page 21
Synchronization......Page 22
Who Am I? Who Are You?......Page 25
Terminating Thread Execution......Page 26
Why Use Threads Over Processes?......Page 29
A Structured Programming Environment......Page 30
Choosing Which Applications to Thread......Page 31
Overview......Page 32
Suitable Tasks for Threading......Page 33
Models......Page 35
Buffering Data Between Threads......Page 40
Some Common Problems......Page 42
Performance......Page 43
Example: An ATM Server......Page 44
Example: A Matrix Multiplication Program......Page 51
Overview......Page 55
Selecting the Right Synchronization Tool......Page 57
Mutex Variables......Page 59
Condition Variables......Page 68
Reader/Writer Locks......Page 71
Synchronization in the ATM Server......Page 75
Thread Pools......Page 81
Overview......Page 88
Setting Thread Attributes......Page 90
The pthread_once Mechanism......Page 93
Keys: Using Thread-Specific Data......Page 96
Cancellation......Page 101
Scheduling Pthreads......Page 110
Mutex Scheduling Attributes......Page 118
Overview......Page 123
Threads and Signals......Page 125
Threadsafe Library Functions and System Calls......Page 132
Cancellation-Safe Library Functions and System Calls......Page 137
Thread-Blocking Library Functions and System Calls......Page 139
Threads and Process Management......Page 140
Multiprocessor Memory Synchronization......Page 143
Overview......Page 144
Understanding Pthreads Implementation......Page 145
Debugging......Page 150
Performance......Page 157
Conclusion......Page 168
Appendix A - Pthreads and DCE......Page 169
What Does the DCE Programmer Have to Do?......Page 171
Example: The ATM as a DCE Server......Page 172
Detaching a Thread......Page 175
Mutex Variables......Page 176
Condition Variables......Page 177
Thread Attributes......Page 178
The pthread_once Function......Page 179
Keys......Page 180
Cancellation......Page 181
Scheduling......Page 182
Signals......Page 183
Threadsafe System Interfaces......Page 184
Error Reporting......Page 185
System Interfaces and Cancellation-Safety......Page 186
Process-Blocking Calls......Page 187
Process Management......Page 188
Appendix C - Pthreads Quick Reference......Page 189


πŸ“œ SIMILAR VOLUMES


PThreads Programming: A POSIX Standard f
✍ Dick Buttlar, Jacqueline Farrell, Bradford Nichols πŸ“‚ Library πŸ“… 1996 πŸ› O'Reilly Media 🌐 English

<div><p>Computers are just as busy as the rest of us nowadays. They have lots of tasks to do at once, and need some cleverness to get them all done at the same time.</p> <p>That's why threads are seen more and more often as a new model for programming. Threads have been available for some time. T

PThreads Programming A POSIX Standard fo
✍ Dick Buttlar, Jacqueline Farrell, Bradford Nichols πŸ“‚ Library πŸ“… 2013 πŸ› O’Reilly 🌐 English

Basic design techniques Mutexes, conditions, and specialized synchronization techniques Scheduling, priorities, and other real-time issues Cancellation UNIX libraries and re-entrant routines Signals Debugging tips Measuring performance Special considerations f

Pthreads Programming: A POSIX Standard f
✍ Bradford Nichols Dick Buttlar Jacqueline Proulx Farrell πŸ“‚ Library πŸ“… 1996 🌐 English

Computers are just as busy as the rest of us nowadays. They have lots of tasks to do at once, and need some cleverness to get them all done at the same time. That's why threads are seen more and more often as a new model for programming. Threads have been available for some time. The Mach operati

Programming with POSIX threads
✍ David R. Butenhof πŸ“‚ Library πŸ“… 1997 πŸ› Addison-Wesley 🌐 English

This book offers an in-depth description of the IEEE operating system interface standard, POSIX (Portable Operating System Interface) threads, commonly called Pthreads. Written for experienced C programmers, but assuming no previous knowledge of threads, the book explains basic concepts such as asyn

Programming with POSIX threads
✍ David R. Butenhof πŸ“‚ Library πŸ“… 1997 πŸ› Addison-Wesley 🌐 English

This book offers an in-depth description of the IEEE operating system interface standard, POSIX (Portable Operating System Interface) threads, commonly called Pthreads. Written for experienced C programmers, but assuming no previous knowledge of threads, the book explains basic concepts such as asyn