wisconsin
Chapter 12: Concurrent Programming

Chapter 12: Concurrent Programming

Content locked

The catalog is public. Reading this content requires approved access.

Sign in to read
Chapter 12: Concurrent Programming
Concurrent Programming
12.1 Concurrent Programming with Processes
12.1.1 A Concurrent Server Based on Processes
12.1.2 Pros and Cons of Processes
Practice Problem 12.1 (solution page 1072)
Practice Problem 12.2 (solution page 1072)
Aside Unix IPC
12.2 Concurrent Programming with I/O Multiplexing
Practice Problem 12.3 (solution page 1072)
12.2.1 A Concurrent Event-Driven Server Based on I/O Multiplexing
Practice Problem 12.4 (solution page 1072)
Aside Event-driven Web servers
12.2.2 Pros and Cons of I/O Multiplexing
12.3 Concurrent Programming with Threads
12.3.1 Thread Execution Model
12.3.2 Posix Threads
12.3.3 Creating Threads
12.3.4 Terminating Threads
12.3.5 Reaping Terminated Threads
12.3.6 Detaching Threads
12.3.7 Initializing Threads
12.3.8 A Concurrent Server Based on Threads
Practice Problem 12.5 (solution page 1072)
12.4 Shared Variables in Threaded Programs
12.4.1 Threads Memory Model
12.4.2 Mapping Variables to Memory
12.4.3 Shared Variables
Practice Problem 12.6 (solution page 1072)
12.5 Synchronizing Threads with Semaphores
Practice Problem 12.7 (solution page 1073)
12.5.1 Progress Graphs
Practice Problem 12.8 (solution page 1074)
12.5.2 Semaphores
Aside Origin of the names P and V
12.5.3 Using Semaphores for Mutual Exclusion
Aside Limitations of progress graphs
12.5.4 Using Semaphores to Schedule Shared Resources
Producer-Consumer Problem
Practice Problem 12.9 (solution page 1074)
Readers-Writers Problem
Practice Problem 12.10 (solution page 1074)
12.5.5 Putting It Together: A Concurrent Server Based on Prethreading
Aside Other synchronization mechanisms
Aside Event-driven programs based on threads
Figure 12.30
All programs
12.6 Using Threads for Parallelism
Characterizing the Performance of Parallel Programs
Practice Problem 12.11 (solution page 1074)
12.7 Other Concurrency Issues
12.7.1 Thread Safety
12.7.2 Reentrancy
Practice Problem 12.12 (solution page 1074)
12.7.3 Using Existing Library Functions in Threaded Programs
12.7.4 Races
Practice Problem 12.13 (solution page 1075)
Practice Problem 12.14 (solution page 1075)
12.7.5 Deadlocks
Practice Problem 12.15 (solution page 1075)
12.8 Summary
Bibliographic Notes
Homework Problems
12.16 ◆
12.17 ◆
12.26
12.27
12.28
12.29
12.31 ◆◆◆
12.32
12.33
12.34
12.35
12.36
12.37
12.38
12.39
Solutions to Practice Problems
Solution to Problem 12.1 (page 1011)
Solution to Problem 12.2 (page 1011)
Solution to Problem 12.3 (page 1016)
Solution to Problem 12.4 (page 1020)
Solution to Problem 12.5 (page 1028)
Solution to Problem 12.6 (page 1031)
Notes:
Solution to Problem 12.7 (page 1034)
Solution to Problem 12.8 (page 1037)
Solution to Problem 12.9 (page 1042)
Solution to Problem 12.10 (page 1044)
Solution to Problem 12.11 (page 1056)
Solution to Problem 12.12 (page 1060)
Solution to Problem 12.13 (page 1062)
Solution to Problem 12.14 (page 1062)
Solution to Problem 12.15 (page 1065)