Using a Smart Event Dispatcher in C++
summary
Covers implementing an event dispatcher in C++ that avoids the lapsed listener problem by storing observers as weak_ptr vector and cleaning dead entries before notifying, warns to don't call under lock because callbacks can modify registration and cause crashes or deadlocks, recommends a copy-and-broadcast approach that removes dead observers while copying, and suggests nonblocking patterns such as launching handlers concurrently or using an executor/task queue to avoid blocking and improve safety and latency.
AI-written summary · about
related talks
01h 20mRevisiting C++ Observers: Spooky Action at a Distance
01h 03mSpooky Action at a Distance
01h 02mThe Observer Design Pattern in Cpp
30mCombining Zephyr & C++20 to Build Safe, Low-footprint, Event-based Applicati...
55mC++ Concurrency TS 2 Use Cases and Future Direction
53mAsync sequences and algorithms to compose them
01h 04mA Pattern Language for Expressing Concurrency in Cpp
05mC Pointers
