Real-time Programming with the C++ Standard Library
summary
Audio callbacks arrive every 1–10 milliseconds so worst‑case bounds matter; exceptions can be zero‑cost on many ABIs but Windows 32‑bit pays runtime cost; stable_sort stable_partition and in_place_merge and parallel algorithms may allocate; std::pmr monotonic_buffer_resource and unsynchronized_pool_resource let you preallocate lock‑free memory for real‑time vectors; std::variant (standard) avoids heap backup that boost::variant does; only atomics are portably real‑time safe; mersenne twister and std::uniform_real_distribution are amortized, use xorshift or a simple LCG instead.
AI-written summary · about
chapters (19)
- 0:00Introduction
- 1:18What is realtime
- 2:39Use Cases
- 7:07Realtime Save Code
- 9:58Nonhosted implementation
- 10:40Freestanding implementation
- 12:20The standard
- 14:50Exceptions
- 15:48Exception Models
- 22:17Variable Length Array
- 23:15Custom Allocators
- 30:17Standard Utilities
- 34:09Lambdas
- 37:31synchronization primitives
- 39:25atomic
- 41:54random numbers
- 43:59random number engines
- 48:08Uniform distributions
- 51:32Questions
related talks
51mUnderstanding Allocator Impact on Runtime Performance in C++
01h 10mBasic usage of PMRs for better performance
01h 29mWhen Nanoseconds Matter: Ultrafast Trading Systems in C++
05mLightning Talk: Micro C++ Benchmarks & Murphy's Law
01h 11m“Benchmarking C++ Code"
52mAliasing in C++ - Risks, Opportunities and Techniques
01h 01mRefresher on Containers, Algorithms and Performance in C++
01h 00m“Want fast C++? Know your hardware!"
