本書利用現實環境中的例子,著重講述并行系統的實踐與應用。介紹了多線程、并行和分布式計算的基本概念,并且把它們與實現和完成過程聯系起來,關注解決方案的正確性和性能。主要內容包括:共享變量程序設計,分布式程序設計,并行程序設計。本書對一些實際案例進行研究,論題包括并行線程、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