contents preface
acknowledgments
about this book
about the cover illustration
Chapter 1 Hello, world of concurrency in C++!
What is concurrency?
Why use concurrency?
Concurrency and multithreading in C++
Getting started
Summary
Chapter 2 Managing threads
Basic thread management
Passing arguments to a thread function
Transferring ownership of a thread
Choosing the number of threads at runtime
Identifying threads
Summary
Chapter 3 Sharing data between threads
Problems with sharing data between threads
Protecting shared data with mutexes
Alternative facilities for protecting shared data
Summary
Chapter 4 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
Summary
Chapter 5 The C++ memory model and operations on atomic types
Memory model basics
Atomic operations and types in C++
Synchronizing operations and enforcing ordering
Summary
Chapter 6 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
Summary
Chapter 7 Designing lock-free concurrent data structures
Definitions and consequences
Examples of lock-free data structures
Guidelines for writing lock-free data structures
Summary
Chapter 8 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
Summary
Chapter 9 Advanced thread management
Thread pools
Interrupting threads
Summary
Chapter 10 Testing and debugging multithreaded applications
Types of concurrency-related bugs
Techniques for locating concurrency-related bugs
Summary
appendix A Brief reference for some C++11 language features
appendix B Brief comparison of concurrency libraries
appendix C A message-passing framework and complete ATM example
appendix D C++ Thread Library reference