Amazon cover image
Image from Amazon.com

Shared Memory Application Programming : Concepts and Strategies in Multicore Application Programming.

By: Publisher: San Francisco : Elsevier Science & Technology, 2015Copyright date: ©2016Description: 1 online resource (557 pages)Content type:
  • text
Media type:
  • computer
Carrier type:
  • online resource
ISBN:
  • 9780128038208
Genre/Form: Additional physical formats: Print version:: Shared Memory Application Programming : Concepts and Strategies in Multicore Application ProgrammingDDC classification:
  • 005.275
LOC classification:
  • QA76.642
Online resources:
Contents:
Front Cover -- Shared Memory Application Programming: Concepts and strategies in multicore application programming -- Copyright -- Contents -- Preface -- Pedagogical Objectives -- Programming Environments -- Book Organization -- Biography -- Acknowledgments -- Chapter 1: Introduction and Overview -- 1.1 Processes and Threads -- 1.2 Overview of Computing Platforms -- 1.2.1 Shared Memory Multiprocessor Systems -- 1.2.2 Distributed Memory Multiprocessor Systems -- 1.2.3 Multicore Evolution -- 1.3 Memory System of Computing Platforms -- 1.3.1 Reading Data from Memory -- 1.3.2 Writing Data to Memory -- 1.4 Parallel Processing Inside Cores -- 1.4.1 Hyperthreading -- 1.4.2 Vectorization -- 1.5 External Computational Devices -- 1.5.1 GPUs -- 1.5.2 Intel Xeon Phi -- 1.6 Final Comments -- Chapter 2: Introducing Threads -- 2.1 Applications and Processes -- 2.1.1 Role of the Stack -- 2.1.2 Multitasking -- 2.2 Multithreaded Processes -- 2.2.1 Launching Threads -- 2.2.2 Memory Organization of a Multithreaded Process -- 2.2.3 Threads as Lightweight Processes -- 2.2.4 How can Several Threads Call the Same Function? -- 2.2.5 Comment About Hyperthreading -- 2.3 Programming and Execution Models -- 2.3.1 Thread Life Cycles -- 2.4 Benefits of Concurrent Programming -- Chapter 3: Creating and Running Threads -- 3.1 Introduction -- 3.2 Overview of Basic Libraries -- 3.3 Overview of Basic Thread Management -- 3.4 Using Posix Threads -- 3.4.1 Pthreads Error Reporting -- 3.4.2 Pthreads Data Types -- 3.4.3 Thread Function -- 3.4.4 Basic Thread Management Interface -- 3.4.5 Detachment State: Joining Threads -- 3.4.6 Simple Examples of Thread Management -- 3.5 Using Windows Threads -- 3.5.1 Creating Windows Threads -- 3.5.2 Joining Windows Threads -- 3.5.3 Windows Examples of Thread Management -- 3.6 C++11 Thread Library -- 3.6.1 C++11 Thread Headers.
3.6.2 C++11 Error Reporting -- 3.6.3 C++11 Data Types -- 3.6.4 Creating and Running C++11 Threads -- 3.6.5 Examples of C++11 Thread Management -- 3.7 SPool Utility -- 3.7.1 Under the SPool Hood -- 3.8 SPool Examples -- 3.8.1 Addition of Two Long Vectors -- 3.8.2 Monte Carlo Computation of π -- 3.8.3 Thread Safety Issue -- 3.9 First Look at OpenMP -- 3.9.1 Example: Computing the Area Under a Curve -- 3.10 Database Search Example -- 3.11 Conclusions -- 3.12 Annex: Coding C++11 Time Durations -- Chapter 4: Thread-Safe Programming -- 4.1 Introduction -- 4.1.1 First Example: The Monte Carlo π Code -- 4.2 Some Library Functions are not Thread Safe -- 4.3 Dealing with Random Number Generators -- 4.3.1 Using Stateless Generators -- 4.3.2 Using Local C++ Objects -- 4.4 Thread Local Storage Services -- 4.4.1 C++11 thread_local Keyword -- 4.4.2 OpenMP threadprivate Directive -- 4.4.3 Windows TLS Services -- 4.4.4 Thread Local Classes in TBB -- 4.4.5 Thread Local Storage in Pthreads -- 4.5 Second Example: A Gaussian Random Generator -- 4.6 Comments on Thread Local Storage -- 4.7 Conclusion -- Chapter 5: Concurrent Access to Shared Data -- 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.4.1 Mutex-Spin-Lock Programming Interface -- 5.4.2 Simple Example: Scalar Product of Two Vectors -- 5.4.3 First, Very Inefficient Version -- 5.4.4 Another Inefficient Version Using Spin Locks -- 5.4.5 Correct Approach -- 5.5 Other Simple Examples -- 5.5.1 Reduction Utility -- 5.5.2 SafeCout: Ordering Multithreaded Output to stdout -- 5.6 Windows Mutual Exclusion -- 5.7 OpenMP Mutual Exclusion -- 5.8 C++11 Mutual Exclusion -- 5.8.1 Scoped Lock Class Templates -- Why is another scoped locking class needed? -- 5.9 TBB Mutual Exclusion -- 5.9.1 Mutex Classes.
5.9.2 Scoped_lock Internal Classes -- 5.10 First Look at Atomic Operations -- 5.10.1 Atomic Operations in OpenMP -- AtomicTest.C example in OpenMP -- 5.11 Container Thread Safety -- 5.11.1 Concurrent Containers -- 5.11.2 TBB Concurrent Container Classes -- 5.12 Comments on Mutual Exclusion Best Practices -- Compound thread-safe operations are not thread-safe -- Chapter 6: Event Synchronization -- 6.1 Idle Waits Versus Spin Waits -- Idle wait, also called system wait -- Busy wait, also called spin wait -- Plan for the rest of the chapter -- 6.2 Condition Variables in Idle Waits -- 6.3 Idle Waits in Pthreads -- 6.3.1 Waiting on a Condition Variable -- 6.3.2 Wait Protocol -- Why should the predicate be checked again on return? -- Why an atomic mutex lock and wait? -- 6.3.3 Waking Up Waiting Threads -- 6.4 Windows Condition Variables -- Handling timed waits. -- 6.5 C++11 condition_variable Class -- Another form of the wait() functions -- 6.6 Examples of Idle Wait -- 6.6.1 Synchronizing with an IO Thread -- 6.6.2 Timed Wait in C++11 -- 6.6.3 Barrier Synchronization -- Problem: this barrier cannot be reused -- Solution: a reusable barrier -- Comments -- 6.7 C++11 Futures and Promises -- 6.7.1 std::future Class -- std::asynch() function -- Basic std::future member functions -- 6.7.2 std::promise Class -- Chapter 7: Cache Coherency and Memory Consistency -- 7.1 Introduction -- 7.2 Cache Coherency Issue -- 7.2.1 False Sharing Problem -- 7.2.2 Memory Consistency Issue -- 7.3 What is a Memory Consistency Model? -- 7.3.1 Sequential Consistency -- 7.3.2 Problems with Sequential Consistency -- 7.4 Weak-Ordering Memory Models -- 7.4.1 Memory Fences -- 7.4.2 Case of a Mutex -- 7.4.3 Programming a Busy Wait -- 7.5 Pthreads Memory Consistency -- 7.6 OpenMP Memory Consistency -- 7.6.1 Flush Directive -- Chapter 8: Atomic Types and Operations -- 8.1 Introduction.
8.2 C++11 std::atomic Class -- 8.2.1 Member Functions -- 8.3 Lock-Free Algorithms -- 8.3.1 Updating an Arbitrary, Global Data Item -- 8.3.2 AReduction Class -- 8.4 Synchronizing Thread Operations -- 8.4.1 Memory Models and Memory Ordering Options -- 8.4.2 Using the Relaxed Model -- 8.4.3 Global Order in Sequential Consistency -- 8.4.4 Comparing Sequential Consistency and Acquire-Release -- 8.4.5 Consume Instead of Acquire Semantics -- 8.4.6 Usefulness of memory_order_acq_rel -- 8.5 Examples of Atomic Synchronizations -- 8.5.1 SPINLOCK Class -- 8.5.2 Circular Buffer Class -- 8.6 TBB atomic Class -- 8.6.1 Memory Ordering Options -- 8.7 Windows Atomic Services -- 8.8 Summary -- Chapter 9: High-Level Synchronization Tools -- 9.1 Introduction and Overview -- 9.2 General Comments on High-Level Synchronization Tools -- 9.3 Overview of the vath Synchronization Utilities -- 9.3.1 Code Organization -- 9.4 Timers -- 9.4.1 Using a Timer -- 9.4.2 Comment on Implementation -- 9.5 Boolean Locks -- 9.5.1 Using the BLock Class -- 9.5.2 BLock Examples -- 9.5.3 Boolean Locks Implementing Spin Waits -- 9.6 SynchP Template Class -- 9.6.1 Using SynchP Objects -- 9.6.2 Comments -- 9.6.3 SynchP Examples -- 9.6.4 OpenMP Version: The OSynchP Class -- 9.7 Idle and Spin Barriers -- 9.7.1 Using the Barrier Classes -- 9.7.2 ABarrier Implementation -- 9.8 Blocking Barriers -- 9.8.1 Using a Blocking Barrier -- 9.8.2 First Simple Example -- 9.8.3 Programming a Simple SPMD Thread Pool -- How the worker threads are launched -- How main() drives the worker thread activity -- How worker threads terminate -- Full example -- 9.9 ThQueue Class -- Design requirements -- 9.9.1 Using the ThQueue Queue -- 9.9.2 Comments on the Producer-Consumer Paradigm -- 9.9.3 Examples: Stopping the Producer-Consumer Operation -- Several Producers: TQueue1.C.
Several Consumers: TQueue2.C -- 9.10 Reader-Writer Locks -- 9.10.1 Pthreads RWMUTEX -- 9.10.2 Windows Slim Reader-Writer Locks -- 9.10.3 TBB Reader-Writer Locks -- 9.11 RWlock Class -- 9.11.1 Example: Emulating a Database Search -- 9.11.2 Example: Accessing a Shared Container -- Writer threads -- Reader threads -- 9.11.3 Comment on Memory Operations -- 9.12 General Overview of Thread Pools -- Chapter 10: OpenMP -- 10.1 Basic Execution Model -- 10.2 Configuring OpenMP -- Controlling program execution -- Controlling parallel regions -- Controlling the automatic parallelization of loops -- 10.3 Thread Management and Work-Sharing Directives -- 10.3.1 Parallel Directive -- Functional parallel clauses: -- 10.3.2 Master and Single Directives -- 10.3.3 Sections and Section Work-Sharing Directives -- 10.3.4 FOR WORK SHARING DIRECTIVE -- 10.3.5 Task Directive -- 10.3.6 Data-Sharing Attributes Clauses -- Comments on data-sharing clauses -- 10.4 Synchronization Directives -- 10.4.1 Critical Directive -- Critical sections can be named -- Named critical sections versus mutex locking -- 10.5 Examples of Parallel and Work-Sharing Constructs -- 10.5.1 Different Styles of Parallel Constructs -- Adding directives to the listing above -- A version using parallel for -- Yet another version of the Monte-Carlo code -- 10.5.2 Checking ICVs and Tracking Thread Activity -- Checking ICVs -- Tracking the mapping of tasks to threads -- 10.5.3 Parallel Section Examples -- Behavior of the barrier directive -- Dispatching a I/O operation -- Data transfers among tasks -- 10.6 Task API -- 10.6.1 Motivations for a Task-Centric Execution Model -- 10.6.2 Event Synchronizations and Explicit Tasks -- 10.6.3 Task Directive and Clauses -- 10.6.4 Task Synchronization -- 10.6.5 OpenMP 4.0 Taskgroup Parallel Construct -- 10.7 Task Examples.
10.7.1 Parallel Operation on the Elements of a Container.
Holdings
Item type Current library Call number Status Date due Barcode Item holds
Ebrary Ebrary Afghanistan Available EBKAF-N00055972
Ebrary Ebrary Algeria Available
Ebrary Ebrary Cyprus Available
Ebrary Ebrary Egypt Available
Ebrary Ebrary Libya Available
Ebrary Ebrary Morocco Available
Ebrary Ebrary Nepal Available EBKNP-N00055972
Ebrary Ebrary Sudan Available
Ebrary Ebrary Tunisia Available
Total holds: 0

Front Cover -- Shared Memory Application Programming: Concepts and strategies in multicore application programming -- Copyright -- Contents -- Preface -- Pedagogical Objectives -- Programming Environments -- Book Organization -- Biography -- Acknowledgments -- Chapter 1: Introduction and Overview -- 1.1 Processes and Threads -- 1.2 Overview of Computing Platforms -- 1.2.1 Shared Memory Multiprocessor Systems -- 1.2.2 Distributed Memory Multiprocessor Systems -- 1.2.3 Multicore Evolution -- 1.3 Memory System of Computing Platforms -- 1.3.1 Reading Data from Memory -- 1.3.2 Writing Data to Memory -- 1.4 Parallel Processing Inside Cores -- 1.4.1 Hyperthreading -- 1.4.2 Vectorization -- 1.5 External Computational Devices -- 1.5.1 GPUs -- 1.5.2 Intel Xeon Phi -- 1.6 Final Comments -- Chapter 2: Introducing Threads -- 2.1 Applications and Processes -- 2.1.1 Role of the Stack -- 2.1.2 Multitasking -- 2.2 Multithreaded Processes -- 2.2.1 Launching Threads -- 2.2.2 Memory Organization of a Multithreaded Process -- 2.2.3 Threads as Lightweight Processes -- 2.2.4 How can Several Threads Call the Same Function? -- 2.2.5 Comment About Hyperthreading -- 2.3 Programming and Execution Models -- 2.3.1 Thread Life Cycles -- 2.4 Benefits of Concurrent Programming -- Chapter 3: Creating and Running Threads -- 3.1 Introduction -- 3.2 Overview of Basic Libraries -- 3.3 Overview of Basic Thread Management -- 3.4 Using Posix Threads -- 3.4.1 Pthreads Error Reporting -- 3.4.2 Pthreads Data Types -- 3.4.3 Thread Function -- 3.4.4 Basic Thread Management Interface -- 3.4.5 Detachment State: Joining Threads -- 3.4.6 Simple Examples of Thread Management -- 3.5 Using Windows Threads -- 3.5.1 Creating Windows Threads -- 3.5.2 Joining Windows Threads -- 3.5.3 Windows Examples of Thread Management -- 3.6 C++11 Thread Library -- 3.6.1 C++11 Thread Headers.

3.6.2 C++11 Error Reporting -- 3.6.3 C++11 Data Types -- 3.6.4 Creating and Running C++11 Threads -- 3.6.5 Examples of C++11 Thread Management -- 3.7 SPool Utility -- 3.7.1 Under the SPool Hood -- 3.8 SPool Examples -- 3.8.1 Addition of Two Long Vectors -- 3.8.2 Monte Carlo Computation of π -- 3.8.3 Thread Safety Issue -- 3.9 First Look at OpenMP -- 3.9.1 Example: Computing the Area Under a Curve -- 3.10 Database Search Example -- 3.11 Conclusions -- 3.12 Annex: Coding C++11 Time Durations -- Chapter 4: Thread-Safe Programming -- 4.1 Introduction -- 4.1.1 First Example: The Monte Carlo π Code -- 4.2 Some Library Functions are not Thread Safe -- 4.3 Dealing with Random Number Generators -- 4.3.1 Using Stateless Generators -- 4.3.2 Using Local C++ Objects -- 4.4 Thread Local Storage Services -- 4.4.1 C++11 thread_local Keyword -- 4.4.2 OpenMP threadprivate Directive -- 4.4.3 Windows TLS Services -- 4.4.4 Thread Local Classes in TBB -- 4.4.5 Thread Local Storage in Pthreads -- 4.5 Second Example: A Gaussian Random Generator -- 4.6 Comments on Thread Local Storage -- 4.7 Conclusion -- Chapter 5: Concurrent Access to Shared Data -- 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.4.1 Mutex-Spin-Lock Programming Interface -- 5.4.2 Simple Example: Scalar Product of Two Vectors -- 5.4.3 First, Very Inefficient Version -- 5.4.4 Another Inefficient Version Using Spin Locks -- 5.4.5 Correct Approach -- 5.5 Other Simple Examples -- 5.5.1 Reduction Utility -- 5.5.2 SafeCout: Ordering Multithreaded Output to stdout -- 5.6 Windows Mutual Exclusion -- 5.7 OpenMP Mutual Exclusion -- 5.8 C++11 Mutual Exclusion -- 5.8.1 Scoped Lock Class Templates -- Why is another scoped locking class needed? -- 5.9 TBB Mutual Exclusion -- 5.9.1 Mutex Classes.

5.9.2 Scoped_lock Internal Classes -- 5.10 First Look at Atomic Operations -- 5.10.1 Atomic Operations in OpenMP -- AtomicTest.C example in OpenMP -- 5.11 Container Thread Safety -- 5.11.1 Concurrent Containers -- 5.11.2 TBB Concurrent Container Classes -- 5.12 Comments on Mutual Exclusion Best Practices -- Compound thread-safe operations are not thread-safe -- Chapter 6: Event Synchronization -- 6.1 Idle Waits Versus Spin Waits -- Idle wait, also called system wait -- Busy wait, also called spin wait -- Plan for the rest of the chapter -- 6.2 Condition Variables in Idle Waits -- 6.3 Idle Waits in Pthreads -- 6.3.1 Waiting on a Condition Variable -- 6.3.2 Wait Protocol -- Why should the predicate be checked again on return? -- Why an atomic mutex lock and wait? -- 6.3.3 Waking Up Waiting Threads -- 6.4 Windows Condition Variables -- Handling timed waits. -- 6.5 C++11 condition_variable Class -- Another form of the wait() functions -- 6.6 Examples of Idle Wait -- 6.6.1 Synchronizing with an IO Thread -- 6.6.2 Timed Wait in C++11 -- 6.6.3 Barrier Synchronization -- Problem: this barrier cannot be reused -- Solution: a reusable barrier -- Comments -- 6.7 C++11 Futures and Promises -- 6.7.1 std::future Class -- std::asynch() function -- Basic std::future member functions -- 6.7.2 std::promise Class -- Chapter 7: Cache Coherency and Memory Consistency -- 7.1 Introduction -- 7.2 Cache Coherency Issue -- 7.2.1 False Sharing Problem -- 7.2.2 Memory Consistency Issue -- 7.3 What is a Memory Consistency Model? -- 7.3.1 Sequential Consistency -- 7.3.2 Problems with Sequential Consistency -- 7.4 Weak-Ordering Memory Models -- 7.4.1 Memory Fences -- 7.4.2 Case of a Mutex -- 7.4.3 Programming a Busy Wait -- 7.5 Pthreads Memory Consistency -- 7.6 OpenMP Memory Consistency -- 7.6.1 Flush Directive -- Chapter 8: Atomic Types and Operations -- 8.1 Introduction.

8.2 C++11 std::atomic Class -- 8.2.1 Member Functions -- 8.3 Lock-Free Algorithms -- 8.3.1 Updating an Arbitrary, Global Data Item -- 8.3.2 AReduction Class -- 8.4 Synchronizing Thread Operations -- 8.4.1 Memory Models and Memory Ordering Options -- 8.4.2 Using the Relaxed Model -- 8.4.3 Global Order in Sequential Consistency -- 8.4.4 Comparing Sequential Consistency and Acquire-Release -- 8.4.5 Consume Instead of Acquire Semantics -- 8.4.6 Usefulness of memory_order_acq_rel -- 8.5 Examples of Atomic Synchronizations -- 8.5.1 SPINLOCK Class -- 8.5.2 Circular Buffer Class -- 8.6 TBB atomic Class -- 8.6.1 Memory Ordering Options -- 8.7 Windows Atomic Services -- 8.8 Summary -- Chapter 9: High-Level Synchronization Tools -- 9.1 Introduction and Overview -- 9.2 General Comments on High-Level Synchronization Tools -- 9.3 Overview of the vath Synchronization Utilities -- 9.3.1 Code Organization -- 9.4 Timers -- 9.4.1 Using a Timer -- 9.4.2 Comment on Implementation -- 9.5 Boolean Locks -- 9.5.1 Using the BLock Class -- 9.5.2 BLock Examples -- 9.5.3 Boolean Locks Implementing Spin Waits -- 9.6 SynchP Template Class -- 9.6.1 Using SynchP Objects -- 9.6.2 Comments -- 9.6.3 SynchP Examples -- 9.6.4 OpenMP Version: The OSynchP Class -- 9.7 Idle and Spin Barriers -- 9.7.1 Using the Barrier Classes -- 9.7.2 ABarrier Implementation -- 9.8 Blocking Barriers -- 9.8.1 Using a Blocking Barrier -- 9.8.2 First Simple Example -- 9.8.3 Programming a Simple SPMD Thread Pool -- How the worker threads are launched -- How main() drives the worker thread activity -- How worker threads terminate -- Full example -- 9.9 ThQueue Class -- Design requirements -- 9.9.1 Using the ThQueue Queue -- 9.9.2 Comments on the Producer-Consumer Paradigm -- 9.9.3 Examples: Stopping the Producer-Consumer Operation -- Several Producers: TQueue1.C.

Several Consumers: TQueue2.C -- 9.10 Reader-Writer Locks -- 9.10.1 Pthreads RWMUTEX -- 9.10.2 Windows Slim Reader-Writer Locks -- 9.10.3 TBB Reader-Writer Locks -- 9.11 RWlock Class -- 9.11.1 Example: Emulating a Database Search -- 9.11.2 Example: Accessing a Shared Container -- Writer threads -- Reader threads -- 9.11.3 Comment on Memory Operations -- 9.12 General Overview of Thread Pools -- Chapter 10: OpenMP -- 10.1 Basic Execution Model -- 10.2 Configuring OpenMP -- Controlling program execution -- Controlling parallel regions -- Controlling the automatic parallelization of loops -- 10.3 Thread Management and Work-Sharing Directives -- 10.3.1 Parallel Directive -- Functional parallel clauses: -- 10.3.2 Master and Single Directives -- 10.3.3 Sections and Section Work-Sharing Directives -- 10.3.4 FOR WORK SHARING DIRECTIVE -- 10.3.5 Task Directive -- 10.3.6 Data-Sharing Attributes Clauses -- Comments on data-sharing clauses -- 10.4 Synchronization Directives -- 10.4.1 Critical Directive -- Critical sections can be named -- Named critical sections versus mutex locking -- 10.5 Examples of Parallel and Work-Sharing Constructs -- 10.5.1 Different Styles of Parallel Constructs -- Adding directives to the listing above -- A version using parallel for -- Yet another version of the Monte-Carlo code -- 10.5.2 Checking ICVs and Tracking Thread Activity -- Checking ICVs -- Tracking the mapping of tasks to threads -- 10.5.3 Parallel Section Examples -- Behavior of the barrier directive -- Dispatching a I/O operation -- Data transfers among tasks -- 10.6 Task API -- 10.6.1 Motivations for a Task-Centric Execution Model -- 10.6.2 Event Synchronizations and Explicit Tasks -- 10.6.3 Task Directive and Clauses -- 10.6.4 Task Synchronization -- 10.6.5 OpenMP 4.0 Taskgroup Parallel Construct -- 10.7 Task Examples.

10.7.1 Parallel Operation on the Elements of a Container.

Description based on publisher supplied metadata and other sources.

Electronic reproduction. Ann Arbor, Michigan : ProQuest Ebook Central, 2019. Available via World Wide Web. Access may be limited to ProQuest Ebook Central affiliated libraries.

There are no comments on this title.

to post a comment.