Book description
Shared Memory Application Programming presents the key concepts and applications of parallel programming, in an accessible and engaging style applicable to developers across many domains. Multithreaded programming is today a core technology, at the basis of all software development projects in any branch of applied computer science. This book guides readers to develop insights about threaded programming and introduces two popular platforms for multicore development: OpenMP and Intel Threading Building Blocks (TBB). Author Victor Alessandrini leverages his rich experience to explain each platform’s design strategies, analyzing the focus and strengths underlying their often complementary capabilities, as well as their interoperability.
The book is divided into two parts: the first develops the essential concepts of thread management and synchronization, discussing the way they are implemented in native multithreading libraries (Windows threads, Pthreads) as well as in the modern C++11 threads standard. The second provides an in-depth discussion of TBB and OpenMP including the latest features in OpenMP 4.0 extensions to ensure readers’ skills are fully up to date. Focus progressively shifts from traditional thread parallelism to modern task parallelism deployed by modern programming environments. Several chapter include examples drawn from a variety of disciplines, including molecular dynamics and image processing, with full source code and a software library incorporating a number of utilities that readers can adapt into their own projects.
- Designed to introduce threading and multicore programming to teach modern coding strategies for developers in applied computing
- Leverages author Victor Alessandrini's rich experience to explain each platform’s design strategies, analyzing the focus and strengths underlying their often complementary capabilities, as well as their interoperability
- Includes complete, up-to-date discussions of OpenMP 4.0 and TBB
- Based on the author’s training sessions, including information on source code and software libraries which can be repurposed
Table of contents
- Cover image
- Title page
- Table of Contents
- Copyright
- Preface
- Biography
- Acknowledgments
- Chapter 1: Introduction and Overview
- Chapter 2: Introducing Threads
-
Chapter 3: Creating and Running Threads
- Abstract
- 3.1 Introduction
- 3.2 Overview of Basic Libraries
- 3.3 Overview of Basic Thread Management
- 3.4 Using Posix Threads
- 3.5 Using Windows Threads
- 3.6 C++11 Thread Library
- 3.7 SPool Utility
- 3.8 SPool Examples
- 3.9 First Look at OpenMP
- 3.10 Database Search Example
- 3.11 Conclusions
- 3.12 Annex: Coding C++11 Time Durations
- Chapter 4: Thread-Safe Programming
-
Chapter 5: Concurrent Access to Shared Data
- Abstract
- 5.1 First Comments on Thread Synchronization
- 5.2 Need for Mutual Exclusion Among Threads
- 5.3 Different Kinds of Mutex Flavors
- 5.4 Pthreads Mutual Exclusion
- 5.5 Other Simple Examples
- 5.6 Windows Mutual Exclusion
- 5.7 OpenMP Mutual Exclusion
- 5.8 C++11 Mutual Exclusion
- 5.9 TBB Mutual Exclusion
- 5.10 First Look at Atomic Operations
- 5.11 Container Thread Safety
- 5.12 Comments on Mutual Exclusion Best Practices
- Chapter 6: Event Synchronization
- Chapter 7: Cache Coherency and Memory Consistency
- Chapter 8: Atomic Types and Operations
-
Chapter 9: High-Level Synchronization Tools
- Abstract
- 9.1 Introduction and Overview
- 9.2 General Comments on High-Level Synchronization Tools
- 9.3 Overview of the vath Synchronization Utilities
- 9.4 Timers
- 9.5 Boolean Locks
- 9.6 SynchP< T > Template Class > Template Class
- 9.7 Idle and Spin Barriers
- 9.8 Blocking Barriers
- 9.9 ThQueue<T> Class
- 9.10 Reader-Writer Locks
- 9.11 RWlock Class
- 9.12 General Overview of Thread Pools
-
Chapter 10: OpenMP
- Abstract
- Overview
- 10.1 Basic Execution Model
- 10.2 Configuring OpenMP
- 10.3 Thread Management and Work-Sharing Directives
- 10.4 Synchronization Directives
- 10.5 Examples of Parallel and Work-Sharing Constructs
- 10.6 Task API
- 10.7 Task Examples
- 10.8 Task Best Practices
- 10.9 Cancellation of Parallel Constructs
- 10.10 Offloading Code Blocks to Accelerators
- 10.11 Thread Affinity
- 10.12 Vectorization
- 10.13 Annex: SafeCounter Utility Class
- Chapter 11: Intel Threading Building Blocks
- Chapter 12: Further Thread Pools
- Chapter 13: Molecular Dynamics Example
- Chapter 14: Further Data Parallel Examples
-
Chapter 15: Pipelining Threads
- Abstract
- 15.1 Pipeline Concurrency Pattern
- 15.2 Example 1: Two-Dimensional Heat Propagation
- 15.3 Sequential Code Heat.C
- 15.4 Pipelined Versions
- 15.5 Pipeline Classes
- 15.6 Example: Pipelined Sor
- 15.7 Pipelining Threads in TBB
- 15.8 Some Performance Considerations
- 15.9 Annex: Solution to the Heat Diffusion Equation
- 15.10 Annex: FFT Routines
-
Chapter 16: Using the TBB Task Scheduler
- Abstract
- 16.1 Introduction
- 16.2 Structure of the TBB Pool
- 16.3 TBB Task Management Classes
- 16.4 Complete Scheduler API: The Task Class
- 16.5 Miscellaneous Task Features
- 16.6 Using the TBB Scheduler
- 16.7 Job Submission by Client Threads
- 16.8 Example: Molecular Dynamics Code
- 16.9 Recycling Parallel Region Tasks
- 16.10 Annex: Task Class Member Functions
- Annex A: Using the Software
- Annex B: C++ Function Objects and Lambda Expressions
- Bibliography
- Index
Product information
- Title: Shared Memory Application Programming
- Author(s):
- Release date: November 2015
- Publisher(s): Morgan Kaufmann
- ISBN: 9780128038208
You might also like
video
NLP in Action: Attention mechanism and upgrading TorchText 0.9
Hobson Lane updates Chapter 12 PyTorch examples for training an encoder-decoder to translate between English and …
book
Topics in Parallel and Distributed Computing
Topics in Parallel and Distributed Computing provides resources and guidance for those learning PDC as well …
book
Nonvolatile Memory Design
The manufacture of flash memory, which is the dominant nonvolatile memory technology, is facing severe technical …
book
Recording Spaces
Recording Spaces deals with the acoustics of rooms intended for musical performance of many styles. It …