本书利用现实环境中的例子,着重讲述并行系统的实践与应用。介绍了多线程、并行和分布式计算的基本概念,并且把它们与实现和完成过程联系起来,关注解决方案的正确性和性能。主要内容包括:共享变量程序设计,分布式程序设计,并行程序设计。本书对一些实际案例进行研究,论题包括并行线程、MPI、OpenMP库,还有Java程序设计语言、Ada、高性能Fortran、Linda、Occam和SR。通过完整程序执行具体的例子,程序和实例皆为共享式和分布式的。样例应用领域包括科学计算和分布式系统。本书适用于多线程、并行和分布式计算课程。 作者Greg Andrews是美国亚利桑那大学计算机科学系教授,其研究涉及包括并发和分布式程序设计的各个层面。
咎捉萄в檬榈奶氐悖
Preface
Chapter 1: The Concurrent Computing Landscape
1.1 The Essence of Concurrent Programming
1.2 Hardware Architectures
1.2.1 Processors and Caches
1.2.2 Shared-Memory Multiprocessors
1.2.3 Distributed-Memory Multicomputers and Networks
1.3 Applications and Programming Styles
1.4 Iterative Parallelism: Matrix Multiplication
1.5 Recursive Parallelism: Adaptive Quadrature
1.6 Producers and Consumers: Unix Pipes
1.7 Clients and Servers: File Systems
1.8 Peers: Distributed Matrix Multiplication
1.9 Summary of Programming Notation
1.9.1 Declarations
1.9.2 Sequential Statements
1.9.3 Concurrent Statements, Processes, and Procedures
1.9.4 Comments
Historical Notes
References
Exercises
Part 1: Shared-Variable Programming
Chapter 2: Processes and Synchronization
2.1 States, Actions, Histories, and Properties
2.2 Parallelization: Finding Patterns in a File
2.3 Synchronization: The Maximum of an Array
2.4 Atomic Actions and Await Statements
2.4.1 Fine-Grained Atomicity
2.4.2 Specifying Synchronization: The Await Statement
2.5 Producer/Consumer Synchronization
2.6 A Synopsis of Axiomatic Semantics
2.6.1 Formal Logical Systems
2.6.2 A Programming Logic
2.6.3 Semantics of Concurrent Execution
2.7 Techniques for Avoiding Interference
2.7.1 Disjoint Variables
2.7.2 Weakened Assertions
2.7.3 Global Invariants
2.7.4 Synchronization
2.7.5 An Example: The Array Copy ProbIem Revisited
2.8 Safety and Liveness Properties
2.8.1 Proving Safety Propertes
2.8.2 Scheduling Policies and Fairness
Historical Notes
References
Exercises
Chapter 3: Locks and Barriers
3.1 The Critical Section Problem
3.2 Critical Sections: Spin Locks
3.2.1 Test and Set
3.2.2 Test and Test and Set
3.2.3 Implementing Await Statements
3.3 Critical Sections: Fair Solutions
3.3.1 The Tie-Breaker Algorithm
3.3.2 The Ticket Algorithm
3.3.3 The Bakery Algorithm
3.4 Barrier Synchronization
3.4.1 Shared Counter
3.4.2 Flags and Coordinators
3.4.3 Symmetric Barriers
3.5 Data Parallel Algorithms
3.5.1 Parallel Prefix Computations
3.5.2 Operations on Linked Lists
3.5.3 Grid Computations: Jacobi Iteration
3.5.4 Synchronous Multiprocessors
3.6 Parallel Computing with a Bag of Tasks
3.6.1 Matrix Multiplication
3.6.2 Adaptive Quadrature
Historical Notes
References
Exercises
Chapter 4: Semaphores
Chapter 5: Monitors
Chapter 6: Implementations
Part 2: Distributed Programming
Chapter 7: Message Passing
Chapter 8: RPC and Rendezvous
Chapter 9: Paradigms for Process Interaction
Chapter 10: lmpIementations
Part 3: ParalleI Programming
Chapter 11: Scientific Computing
Chapter 12: Languages, Compilers,Libraries, and TooIs
Glossary
Index