SitePoint
Blog
Forum
Library
Login
Join Premium
Toggle sidebar
Concurrency with Modern C++
Toggle community discussions
Close
Content
Bookmarks
Preface
Concurrency with Modern C++
What every professional C++ programmer should know about concurrency.
Reader Testimonials
Introduction
Conventions
Source Code
How should you read the book?
Personal Notes
1
Concurrency with Modern C++
A Quick Overview
1.1 C++11 and C++14: The Foundation
1.2 C++17: Parallel Algorithms of the Standard Template Library
1.3 Coroutines
1.4 Case Studies
1.5 Variations of Futures
1.6 Modification and Generalization of a Generator
1.7 Various Job Workflows
1.8 The Future: C++23
1.9 Patterns and Best Practices
1.10 Data Structures
1.11 Challenges
1.12 Time Library
1.13 CppMem
1.14 Glossary
Memory Model
The Details
2.1 Basics of the Memory Model
2.2 The Contract
2.3 Atomics
2.4 The Synchronization and Ordering Constraints
2.5 Fences
Multithreading
3.1 The Basic Thread std::thread
3.2 The Improved Thread std::jthread (C++20)
3.3 Shared Data
3.4 Thread-Local Data
3.5 Condition Variables
3.6 Cooperative Interruption (C++20)
3.7 Semaphores (C++20)
3.8 Latches and Barriers (C++20)
3.9 Tasks
3.10 Synchronized Outputstreams (C++20)
Parallel Algorithms of the Standard Template Library
4.1 Execution Policies
4.2 Algorithms
4.3 The New Algorithms
4.4 Compiler Support
4.5 Performance
Coroutines (C++20)
5.1 A Generator Function
5.2 Characteristics
5.3 The Framework
5.4 Awaitables and Awaiters
5.5 The Workflows
5.6 co_return
5.7 co_yield
5.8 co_await
Case Studies
6.1 Calculating the Sum of a Vector
6.2 The Dining Philosophers Problem by Andre Adrian
6.3 Thread-Safe Initialization of a Singleton
6.4 Ongoing Optimization with CppMem
6.5 Fast Synchronization of Threads
6.6 Variations of Futures
6.7 Modification and Generalization of a Generator
6.8 Various Job Workflows
The Future: C++23
7.1 Executors
7.2 Extended Futures
7.3 Transactional Memory
7.4 Task Blocks
7.5 Data-Parallel Vector Library
Patterns and Best Practices
Patterns
8.1 History
8.2 Invaluable Value
8.3 Pattern versus Best Practices
8.4 Anti-Pattern
Synchronization Patterns
9.1 Dealing with Sharing
9.2 Dealing with Mutation
Concurrent Architecture
10.1 Active Object
10.2 Monitor Object
10.3 Half-Sync/Half-Async
10.4 Reactor
10.5 Proactor
10.6 Further Information
Best Practices
11.1 General
11.2 Multithreading
11.3 Memory Model
General Considerations
Data Structures
12.1 Concurrent Stack
12.2 Locking Strategy
12.3 Granularity of the Interface
12.4 Typical Usage Pattern
12.5 Avoidance of Loopholes
12.6 Contention
12.7 Scalability
12.8 Invariants
12.9 Exceptions
Lock-Based Data Structures
13.1 Concurrent Queue
Lock-Free Data Structures
14.1 General Considerations
14.2 Concurrent Stack
14.3 Concurrent Queue
Challenges
Further Information
15.1 ABA Problem
15.2 Blocking Issues
15.3 Breaking of Program Invariants
15.4 Data Races
15.5 Deadlocks
15.6 False Sharing
15.7 Lifetime Issues of Variables
15.8 Moving Threads
15.9 Race Conditions
The Time Library
16.1 The Interplay of Time Point, Time Duration, and Clock
16.2 Time Point
16.3 Time Duration
16.4 Clocks
16.5 Sleep and Wait
CppMem - An Overview
17.1 The simplified Overview
Glossary
18.1 adress_free
18.2 ACID
18.3 CAS
18.4 Callable Unit
18.5 Complexity
18.6 Concepts
18.7 Concurrency
18.8 Critical Section
18.9 Deadlock
18.10 Eager Evaluation
18.11 Executor
18.12 Function Objects
18.13 Lambda Functions
18.14 Lazy evaluation
18.15 Lock-free
18.16 Lock-based
18.17 Lost Wakeup
18.18 Math Laws
18.19 Memory Location
18.20 Memory Model
18.21 Modification Order
18.22 Monad
18.23 Non-blocking
18.24 obstruction-free
18.25 Parallelism
18.26 Predicate
18.27 Pattern
18.28 RAII
18.29 Release Sequence
18.30 Sequential Consistency
18.31 Sequence Point
18.32 Spurious Wakeup
18.33 Thread
18.34 Total order
18.35 TriviallyCopyable
18.36 Undefined Behavior
18.37 volatile
18.38 wait-free
Index
Open text modal
Community Questions
Close