C++ Concurrency in Action: Practical Multithreading
by Anthony Williams
ISBN: 9781933988771
Manning Publications Co.

Early Access copies of 2nd edition covering C++17 and the Concurrency TS now available.

C++ Concurrency in Action is the definitive reference and guide to the new C++11 Standard. It is suitable for experienced C++ programmers as well as those who have never written multithreaded code. This book will show you how to write robust multithreaded applications in C++ while avoiding many common pitfalls.

It's not just the best current treatment of C++11's threading facilities ... it's likely to remain the best for some time to come.Scott Meyers

Table of Contents

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