Chris is a senior C++ engineer working at Bloomberg LP on a developer experience team for a large organization within the company's market data pipeline. Chris has 8 years of experience working professionally with C++ and has worked on a wide breadth of projects, from low-latency stream processing, to lock free data structure design, to DevX and build system orchestration.
In 2011, C++ introduced a formally defined memory model, providing a foundation for portable, multi-threaded code with well-defined correctness guarantees. This was a major milestone, enabling expressive threading primitives and safe concurrency patterns while allowing low-level optimizations for performance. By default, C++ atomics enforce sequential consistency, which ensures intuitive, predictable behavior. However, these strong guarantees often exceed what’s necessary for correctness and come with a performance cost. This talk delves into weaker memory orderings, particularly acquire/release and relaxed semantics, using a ring buffer as a practical example of how they can be used. We’ll also examine how the C++ memory […]
Heterogeneous containers ("vectors of variants") are an extremely flexible and useful abstraction across many data domains, but std::vector<std::variant<...>> can exhibit extremely bad memory characteristics for mixed types of disparate size, especially if the largest types are relatively uncommon in practice. Variants always have to be at least as large as their largest contained type, and vector implicitly requires all of its members to be the same size, leading to significant bloat in such cases. This talk explores the design of a bit-packed replacement data structure that can achieve massive improvements in memory usage while exporting essentially the same API.