~/talk

Revisiting C++ Observers: Spooky Action at a Distance

Talkat ACCU 2023 · 2023-04-19..04-22· [c-and-cpp, frontend-architecture]
slides:none on file

Reexamines concrete Observer implementations in C++ and shows why no one recipe survives real code: uses a std::vector of raw pointers, lazy-initialized containers, a global unordered_map registry, deferred cleanup (mark-as-null then sweep), copying the observer list under lock to broadcast, and a proxy with non-type tag to disambiguate overloads. Demonstrates recursive remove, thread races, and deadlocks with mutexes, argues for copying/value semantics over heavy locking, and concludes there is no universal library solution — pick minimal, documented policies for your workload.

AI-written summary · about

  1. 0:00Spooky action introduction
  2. 2:12C++ design patterns critique
  3. 6:51Observer vocabulary
  4. 9:18Trivial registration
  5. 12:53Local reasoning with observers
  6. 19:35Order sensitivity in notifications
  7. 23:12Broadcasting notifications
  8. 26:20Recursive deregistration
  9. 29:55Intrusive vs non-intrusive
  10. 35:17Thread safety challenges
  11. 43:07Value semantics in observers
  12. 48:29Deferred deletion thread safety
  13. 51:45Robust observer impossibility
  14. 53:11Actor facade for boilerplate
  15. 59:15Disambiguating events with tags
  16. 1:08:50Reusable observer proxies
  17. 1:11:44Observer networks as state
  18. 1:13:32Q&A
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.