C++ Concurrency in Action: Practical Multithreading
by Anthony Williams
Table of Contents
- Hello, world of concurrency in C++!
- What is Concurrency?
- Why Use Concurrency?
- Concurrency and Multithreading in C++
- Getting Started
- Managing threads
- Basic thread managment
- Passing arguments to a thread function
- Transferring ownership of a thread
- Choosing the number of threads at runtime
- Identifying threads
- Sharing data between threads
- Problems with sharing data between threads
- Protecting shared data with mutexes
- Alternative facilities for protecting shared data
- Synchronizing concurrent operations
- Waiting for an event or other condition
- Waiting for one-off events with futures
- Waiting with a time limit
- Using synchronization of operations to simplify code
- The C++ memory model and operations on atomic types
- Memory model basics
- Atomic operations and types in C++
- Synchronizing operations and enforcing ordering
- Designing lock-based concurrent data structures
- What does it mean to design for concurrency?
- Lock-based concurrent data structures
- Designing more complex lock-based data structures
- Designing lock-free concurrent data structures
- Definitions and consequences
- Examples of lock-free data structures
- Guidelines for writing lock-free data structures
- Designing concurrent code
- Techniques for dividing work between threads
- Factors affecting the performance of concurrent code
- Designing data structures for multithreaded performance
- Additional considerations when designing for concurrency
- Designing concurrent code in practice
- Advanced thread management
- Thread pools
- Interrupting Threads
- Parallel algorithms
- Parallelizing the standard library algorithms
- Execution policies
- The parallel algorithms from the C++ Standard
Library
- Testing and debugging multithreaded applications
- Types of concurrency-related bugs
- Techniques for locating concurrency-related bugs
- Brief reference for some C++11 language features
- Brief comparison of concurrency libraries
- A message-passing framework and complete ATM example
- C++ Thread Library reference