Multithreaded Programming Guide
검색에만이 책은
PDF로 이 문서 다운로드

............................Code Samples

Code Example 2-1 A Simple Threads Program21
Code Example 2-2 Thread-Specific Data--Global but Private24
Code Example 2-3 Turning Global References Into Private References .25
Code Example 2-4 Initializing the Thread-Specific Data26
Code Example 2-5 thr_create() Creates Thread With New Signal Mask 31
Code Example 3-1 Mutex Lock Example43
Code Example 3-2 Deadlock44
Code Example 3-3 Conditional Locking45
Code Example 3-4 Singly Linked List Structure46
Code Example 3-5 Singly Linked List with Nested Locking47
Code Example 3-6 Circular Linked List Structure47
Code Example 3-7 Circular Linked List With Nested Locking48
Code Example 3-8 Example Using cond_wait(3T) and cond_signal(3T) 52
Code Example 3-9 Timed Condition Wait53
Code Example 3-10 Condition Variable Broadcast54
Code Example 3-11 The Producer/Consumer Problem and Condition Variables57
Code Example 3-12 The Producer/Consumer Problem--the Producer58
Code Example 3-13 The Producer/Consumer Problem--the Consumer .59
Code Example 3-14 Read/Write Bank Account66
Code Example 3-15 The Producer/Consumer Problem With Semaphores 73
Code Example 3-16 The Producer/Consumer Problem--the Producer74
Code Example 3-17 The Producer/Consumer Problem--the Consumer .74
Code Example 3-18 The Producer/Consumer Problem, Using USYNC_PROCESS76
Code Example 4-1 Continuation Semantics88
Code Example 4-2 Asynchronous Signals and sigwait(2)91
Code Example 4-3 Completion Semantics92
Code Example 4-4 Condition Variables and Interrupted Waits95
Code Example 5-1 Degrees of Thread Safety102
Code Example 7-1 Global Variables and errno114
Code Example 7-2 The gethostbyname() Problem115
Code Example 7-3 The printf() Problem116
Code Example 7-4 Testing the Invariant With assert(3X)118
Code Example 7-5 The Producer/Consumer Problem--Shared Memory Multiprocessors126
Code Example 7-6 Mutual Exclusion for Two Threads?128
Code Example 7-7 Multithreaded Cooperation (Barrier Synchronization) 129
Code Example A-1 File Copy Example With a Semaphore132
Code Example A-2 Matrix Multiplication133
Code Example A-3 RPC rstat Program With Multithreaded Client137
Code Example A-4 Window Server142