Video & On-Demand

Exceptional C++ - Victor Ciura - CppCon 2021

Registration is now open for CppCon 2022, which starts on September 11 and will again be held both in person and online. To whet your appetite for this year’s conference, we’re posting videos of some of the top-rated talks from last year’s conference. Here’s another CppCon talk video we hope you will enjoy – and why not register today for CppCon 2022 to attend in person, online, or both!

Exceptional C++

by Victor Ciura

Summary of the video:

When writing code we usually focus our attention on the happy paths - that’s where the interesting stuff happens. But there are also plenty of exciting things happening on the error handling flow, too. Although not universally loved/used, exceptions are a powerful mechanism of maneuvering execution on the unhappy path.

Even if std::exception and related machinery are not your cup of tea, you might care about hardware faults or OS signals like access violations, page errors, ALU overflows.

Let’s take a deep dive and explore what happens when an exception occurs, both at the application level and the OS level. We’ll explore the unwind process, the compiler generated code, the CRT hooks available and other exception internals. As we’re taking the scenic Windows route, we’re also going to encounter async exceptions (structured exceptions) on our quest for a better crash. We’ll poke into these mechanisms and see how we can leverage them in our application error handling. Did I mention threads? Routing exceptions between threads… oh my!

Design and Implementation of Highly Scalable Quantifiable Data Structures - CppCon 2021--Victor Cook

Registration is now open for CppCon 2022, which starts on September 11 and will again be held both in person and online. To whet your appetite for this year’s conference, we’re posting videos of some of the top-rated talks from last year’s conference. Here’s another CppCon talk video we hope you will enjoy – and why not register today for CppCon 2022 to attend in person, online, or both!

Design and Implementation of Highly Scalable Quantifiable Data Structures in C++

by Victor Cook

Summary of the video:

Architectural imperatives due to the slowing of Moore's Law, the broad acceptance of relaxed semantics and the O(n!) worst case verification complexity of generating sequential histories motivate a new approach to concurrent correctness. Quantifiability is proposed as a novel correctness condition that models a system in vector space to launch a new mathematical analysis of concurrency. Analysis is facilitated with linear algebra, better supported and of much more efficient time complexity than traditional combinatorial methods.

In this talk, we present the design and implementation of a lock-free quantifiable stack (QStack) and a lock-free quantifiable queue (QQueue) in the C++ programming language. Our design achieves lock-freedom using compare_exchange_strong from the C++17 Atomic Operations Library. We depict several code snippets that illustrate how quantifiable data structures are highly scalable through use of relaxed semantics, an explicit implementation trade-off permitted by quantifiability. We explain how to reason about the correctness of quantifiable data structures and present a technique and a dynamic analysis tool developed in C++ for efficiently verifying a concurrent history as quantifiably correct, referred to as Vector Space Verification (VSV). We illustrate why it is impractical to use alternative verification techniques that compare concurrent histories to sequential histories for determining correctness for real programs.

We showcase the performance of quantifiable data structures by presenting a live demonstration that runs the QStack and QQueue and plots the results in real time. The QStack is compared with the lock-free Elimination Backoff Stack and the lock-free Treiber stack. The QQueue is compared with the lock-free LCRQ, and the wait-free Fetch-And-Add queue. The live performance demonstration illustrates how the QStack and QQueue achieve substantially higher scalability than the state-of-the-art linearizable counterparts. We also present a live demonstration of our VSV tool to dynamically check a concurrent history for the QStack and QQueue as quantifiably correct in less than O(n^2) time.

Data Orientation For The Win! - Eduardo Madrid - CppCon 2021

Registration is now open for CppCon 2022, which starts on September 11 and will again be held both in person and online. To whet your appetite for this year’s conference, we’re posting videos of some of the top-rated talks from last year’s conference. Here’s another CppCon talk video we hope you will enjoy – and why not register today for CppCon 2022 to attend in person, online, or both!

Data Orientation For The Win!

by Eduardo Madrid

Summary of the video:

C++ conferences have had presentations showing the important performance benefits of data-oriented design principles; however, the principles seem to require lots of "manual" effort and "code uglification"; these make the principles less practical, and there haven't been clear recommendations about how to deal with runtime-polymorphic types.

In this talk we will recapitulate on data orientation principles and their benefits showing their application through production-strength Generic Programming components made to support them.

Specific examples include:
1. Structures of arrays instead of arrays of complex structures (a.k.a. "scattering")
2. Support for data oriented designs for runtime-polymorphism without inheritance+virtual (the equivalent of using std::variant or std::function, but generalized as allowed by the Zoo type-erasure framework)
----1. Hybrid buffers: the equivalent of the virtual table pointer is scattered out of the objects solving the "Goldilocks problem" of how big the local buffer should be, objects occupy the available space optimally
----2. Easy (de)serialization through very easy relocatability
----3. Voiding the need for pointers in favor of indices into arrays

Configuration, Extension, Maintainability - Titus Winters - CppCon 2021

Registration is now open for CppCon 2022, which starts on September 11 and will again be held both in person and online. To whet your appetite for this year’s conference, we’re posting videos of some of the top-rated talks from last year’s conference. Here’s another CppCon talk video we hope you will enjoy – and why not register today for CppCon 2022 to attend in person, online, or both!

Configuration, Extension, Maintainability

by Titus Winters

Summary of the video:

Configurability should be considered a potential design smell, especially for systems and interfaces that will be in use for a long time. As an unfortunate result, “No, please don’t add that feature” must be a viable response to design proposals - just because a change can be made doesn’t mean it should. This is particularly challenging to square with a customer-focused product mindset: it’s hard to balance between long-term needs and immediate “the customer is always right.”

Providing options and toggles to configure settings gives users more freedom, but those settings become stale and brittle almost immediately, and regularly wind up pessimizing overall efficiency results. This is particularly true of rarely-used forms of extensibility and configuration. Of course, whatever sort of optionality and customization you provide will be hard to ever undo, because of Hyrum’s Law.

At the root of it, there is a fundamental tension between customization, extensibility, configuration vs. centralization, efficiency, and evolvability, and this tension needs to be considered when you are evaluating whether to add new customization and extensibility options. This talk will address some of the basic ways that design and invariants interact with long-term maintenance and optimization, and some heuristics for deciding whether adding a knob will turn out to be a mistake.

Law of Demeter: A Practical Guide to Loose Coupling - Kris Jusiak - CppCon 2021

Registration is now open for CppCon 2022, which starts on September 11 and will again be held both in person and online. To whet your appetite for this year’s conference, we’re posting videos of some of the top-rated talks from last year’s conference. Here’s another CppCon talk video we hope you will enjoy – and why not register today for CppCon 2022 to attend in person, online, or both!

Law of Demeter: A Practical Guide to Loose Coupling

by Kris Jusiak

Summary of the video:

In this practical session, we will go through examples that follow and/or violate the Law of Demeter principle (LoD) [1].

We will take a deep dive into what kind of design issues that exposes and how to fix them.
Additionally, we will focus on the testing aspect of following the LoD principle together with Single Responsibility and Dependency Inversion principles.

At the end of this session, the audience will have a better understanding of how to write a loosely coupled code, how to easily test it and why the Law of Demeter principle is so important in Software Design.

Let's !"only talk to our immediate friends" at CppCon-2021!

Implementing C++ Modules: Lessons Learned... - Cameron DaCamara & Gabriel Dos Reis - Cppcon 2021

Registration is now open for CppCon 2022, which starts on September 11 and will again be held both in person and online. To whet your appetite for this year’s conference, we’re posting videos of some of the top-rated talks from last year’s conference. Here’s another CppCon talk video we hope you will enjoy – and why not register today for CppCon 2022 to attend in person, online, or both!

Implementing C++ Modules: Lessons Learned, Lessons Abandoned

by Cameron DaCamara & Gabriel Dos Reis

Summary of the video:

C++ Modules were designed to bring more safety to your programs, while dramatically reducing compile time, resulting in overall increased productivity. How can your C++ toolchain meet this challenge? What can you do to take advantage of these new functionalities available in your toolbox? In this talk, we share lessons learned from implementing Modules based on the singular idea of providing robust support through the entire toolchain (from the lexer through the linker, the IDE, the build system, etc.), debunking the misconception that C++ Modules are just some syntactic sugar that is compiled away by the front-end. The challenges that any C++ compiler implementer faces include: (1) how to satisfy the requirements of merging materialization of declarations -- needed for sound handling of the global module fragments, in particular, as found in header files and header units – with associated performance cost; (2) how to take advantage of the One Definition Rule guarantees provided by named modules. They must address those challenges without compromising efficiency and static semantics. These lessons are valuable not just to C++ tools developers, but to ordinary C++ programmers as well, shedding light on how speed and safety gains are achieved by staying close to the spirit of the original C++ Modules design (“take the ODR as foundational”), and how you can put them to good use in the architecture of your programs and libraries.

Faster, Easier, Simpler Vectors - David Stone - CppCon 2021

Registration is now open for CppCon 2022, which starts on September 11 and will again be held both in person and online. To whet your appetite for this year’s conference, we’re posting videos of some of the top-rated talks from last year’s conference. Here’s another CppCon talk video we hope you will enjoy – and why not register today for CppCon 2022 to attend in person, online, or both!

Faster, Easier, Simpler Vectors

by David Stone

Summary of the video:

The standard library has the type `std::vector`. It is used ubiquitously as a high-performance container. However, it was standardized in the mid 90s and C++ has seen many changes since then. It has been extended with allocators, move semantics, initializer_list, and much more. Can we do better?

We can. It is possible to write a container and a set of algorithms that are more efficient at run time, have simpler implementations, and have easier, more intuitive APIs. Not only that, but we can also make it easy for users to write their own vector-like containers that make slightly different trade-offs for when you need even more performance, and this presentation includes discussion of several such vectors.

We will go through specific examples of these vector-like types and the algorithms that operate on them, and then take from that general principles of software design. We'll look into how we're limited in what we can do by C++ as it exists today and what up-and-coming proposals can make things even better.

C++20: The Small Pearls - Rainer Grimm - CppCon 2021

Registration is now open for CppCon 2022, which starts on September 11 and will again be held both in person and online. To whet your appetite for this year’s conference, we’re posting videos of some of the top-rated talks from last year’s conference. Here’s another CppCon talk video we hope you will enjoy – and why not register today for CppCon 2022 to attend in person, online, or both!

C++20: The Small Pearls

by Rainer Grimm

Summary of the video:

C++20 has way more to offer than the big four concepts, ranges, modules, and coroutines.
Here are a few of the shining pearls.

The spaceship operation automatically creates the six comparison operators. Thanks to consteval, constinit, and improved templates, programming at compile time becomes more powerful. std::span supports safe access to contiguous memory blocks. An enhanced time library and a new type date. Comfortable formatting of data thanks to std::format. Easily synchronize or coordinate threats with semaphores or latches and barriers. An improved thread that maintains itself and supports interruption. Thanks to the synchronized output streams, write operations in the concurrent environment do not end in a mess.