| |
| Code Example 2-1 A Simple Threads Program | 16 |
| Code Example 2-2 Thread-Specific Data--Global but Private | 22 |
| Code Example 2-3 Turning Global References Into Private References . | 23 |
| Code Example 2-4 Initializing the Thread-Specific Data | 24 |
| Code Example 3-1 Creating a Detached Thread | 48 |
| Code Example 3-2 Creating a Prioritized Thread | 59 |
| Code Example 4-1 Mutex Lock Example | 82 |
| Code Example 4-2 Deadlock | 83 |
| Code Example 4-3 Conditional Locking | 84 |
| Code Example 4-4 Singly Linked List Structure | 84 |
| Code Example 4-5 Singly-Linked List with Nested Locking | 85 |
| Code Example 4-6 Circular Linked List Structure | 86 |
| Code Example 4-7 Circular Linked List With Nested Locking | 86 |
| Code Example 4-8 Using pthread_cond_wait() and pthread_cond_signal() | 97 |
| Code Example 4-9 Timed Condition Wait | 99 |
| Code Example 4-10 Condition Variable Broadcast | 100 |
| |
| Code Example 4-11 The Producer/Consumer Problem and Condition Variables | 103 |
| Code Example 4-12 The Producer/Consumer Problem - the Producer | 104 |
| Code Example 4-13 The Producer/Consumer Problem - the Consumer . 105 |
| Code Example 4-14 The Producer/Consumer Problem With Semaphores 114 |
| Code Example 4-15 The Producer/Consumer Problem - the Producer | 115 |
| Code Example 4-16 The Producer/Consumer Problem - the Consumer . 115 |
| Code Example 4-17 Synchronization Across Process Boundaries | 116 |
| Code Example 5-1 Continuation Semantics | 134 |
| Code Example 5-2 Asynchronous Signals and sigwait(2) | 138 |
| Code Example 5-3 Completion Semantics | 139 |
| Code Example 5-4 Condition Variables and Interrupted Waits | 143 |
| Code Example 6-1 Degrees of Thread Safety | 150 |
| Code Example 9-1 Read/Write Bank Account | 199 |
| Code Example 9-2 The Producer/Consumer Problem, Using USYNC_PROCESS | 222 |
| Code Example 10-1 Global Variables and errno | 226 |
| Code Example 10-2 The gethostbyname() Problem | 227 |
| Code Example 10-3 The printf() Problem | 228 |
| Code Example 10-4 Testing the Invariant With assert(3X) | 231 |
| Code Example 10-5 The Producer/Consumer Problem--Shared Memory Multiprocessors | 241 |
| Code Example 10-6 Mutual Exclusion for Two Threads? | 243 |
| Code Example 10-7 Multithreaded Cooperation (Barrier Synchronization) 244 |
| Code Example A-1 Solaris Threads Example: barrier.c | 249 |