Hazard Pointers and RCU in C++26

Speaker: Marek Krajewski

Audience level: [ Beginner | Intermediate ]

We all are being constantly warned that multithreading is HARD and that we need more high-level concepts for structured concurrency. Nonetheless most of us is still using basic tools of the trade - threads and locks, which are notoriously hard to be used correctly.

As concurrency is a key factor for achieving high performance, C++26 will introduce new thread synchronization mechanisms: hazard pointers and RCU. For most C++ programmers these aren't exactly household names, even if they happen to be using multithreading.

In this talk we will explain what these novel constructs are, where are they coming from, and what are their standard usage scenarios. Then we will have a look at the support provided for them in C++26 and its design choices. Finally, we will have a look at usage of the new constructs in existing production code and compare them to alternative, more basic mechanisms.

This talk should provide a beginner or intermediate programmer with conceptual overview of problems these mechanisms adress and quite different kinds of solutions they propose.