CppCon 2025 Building Robust Inter-Process Queues in C++ -- Jody Hagins
Registration is now open for CppCon 2025! The conference starts on September 13 and will be held in person in Aurora, CO. To whet your appetite for this year’s conference, we’re posting some upcoming talks that you will be able to attend this year. Here’s another CppCon future talk we hope you will enjoy – and register today for CppCon 2025!
Building Robust Inter-Process Queues in C++
Monday, September 15 14:00 - 15:00 MDT
by Jody Hagins
Summary of the talk:
This talk will offer design and implementation details of a queue intended to be used between multiple processes.
The C++ standard was written with a single-process worldview, mentioning processes only once—in a note stating that lock-free atomic operations work across process boundaries. This has led to widespread but incorrect advice about using std::atomic in shared memory. When moving queue implementations from threads to processes, seemingly rock-solid code can induce undefined behavior.
In addition, traditional queue interfaces are fundamentally insufficient for cross-process communication. A properly designed inter-process queue API must enforce role separation, ensuring that a process can only perform operations appropriate to its designated role. For example, a producer process should not be able to consume messages or manage the queue itself, and the API should prevent multiple processes from accidentally assuming the same role in a single-producer design.
By the end of this talk, you will understand the fundamental differences between thread process synchronization, how to design proper interfaces for interprocess queues that enforce correct usage across process boundaries, and practical techniques to ensure your cross-process code works reliably in production environments.
Oh yeah, and you will have a full implementation that you can use and improve upon.
Jody Hagins has been using C++ for the better part of four decades. He remains amazed at how much he does not know after all those years. He has spent most of that time designing and building systems in C++, for use in the high frequency trading space.