Serial and parallel pipelines in modern C++
summary
Builds a custom pipeline framework that uses std::expected as the node interface, composes with std::ranges style pipe syntax, and handles heterogeneous errors via std::variant. Serial pipelines pass expected results; the parallel version spawns one thread per node and communicates with synchronized queues that use a nested-expected sentinel to stop threads. Benchmarks show mixed results—some workloads slow down, but a larger data-parallel experiment yields about a fourfold speedup. Code and slides are published on the linked GitHub.
AI-written summary · about
chapters (19)
- 0:00Introduction
- 2:02Pipelines and functional programming
- 3:31What is a pipeline?
- 5:15Pipelines in Unix history
- 8:26Pipe operator in C++
- 10:36Simple pipeline implementation
- 12:44Handling different interfaces
- 15:18Error handling with std::expected
- 20:26Example with std::expected
- 24:23Building a serial pipeline
- 26:29Vector normalization pipeline
- 28:17Loading and processing vectors
- 36:19Parallel pipelines introduction
- 37:22Serial vs parallel pipelines
- 38:29Parallel pipeline implementation
- 44:34Synchronized queues
- 48:13Performance comparison
- 53:44Conclusions and recommendations
- 1:02:55Q&A
