Spooky Action at a Distance
summary
Compares concrete Observer implementations used in a real C++ codebase and measures tradeoffs: a simple vector-of-callbacks versus indexed registries and signal libraries, costs of small-object optimization and local buffering, and the performance and memory numbers when thousands of tiny widgets register. Shows failure modes like remove-during-notify bug and duplicate subscriptions, describes designs to enforce ordering, single-vs-multiple registration, and registration priority groups, and gives cleanup and lifetime strategies that proved practical in production.
AI-written summary · about
chapters (11)
- 0:00Introduction
- 1:00What is spooky action
- 4:13Examples and applications
- 10:06Design patterns
- 17:05Observer pattern
- 22:07Implementation challenges
- 30:09Notification prioritization
- 36:10Side effects and risks
- 43:20Robust solutions
- 51:02Optimizing small objects
- 55:29Final conclusions
related talks
01h 20mRevisiting C++ Observers: Spooky Action at a Distance
01h 02mThe Observer Design Pattern in Cpp
04mUsing a Smart Event Dispatcher in C++
33mThe Observer tip-jar
29mWatch your back, Browser! You're being observed
21mObserver Driven Design
53mAsync sequences and algorithms to compose them
29mRevolutionary Signals
