~/talk

Generic Locking in C++

Talkat NDC Oslo 2016 · 2016-06-08..06-10· [concurrency, c-and-cpp]
slides:none on file

Library used in production at Facebook (thousands of uses, ~7,000 occurrences) implements generic locking by wrapping any T as synchronized<T,SharedMutex> that stores the data and a mutable mutex. Calls use operator-> returns a locked proxy which constructs a temporary lock object (RAII) so locks by constness (const=shared, non-const=exclusive). Macros like synchronized and synchronized_con shadow a local L-value so code runs inside the critical section; dual-synchronize orders locks by pointer address to avoid deadlock and unsynchronize temporarily disables locking.

AI-written summary · about

  1. 0:00Introduction
  2. 4:13Volatiles
  3. 6:12Multithreading
  4. 9:22Cx1x
  5. 10:09STD Containers
  6. 14:04Encapsulation
  7. 19:36Implementation
  8. 20:01Synchronous
  9. 22:43Build from data
  10. 23:08Cycle detection
  11. 26:39Synchronized pipe
  12. 28:35Recap
  13. 31:50Locking Pointer
  14. 32:23Move
  15. 33:43Parse
  16. 35:02LogPointer
  17. 35:22C Begin
  18. 37:16You Know That Macro
  19. 38:02Rookie Mistake
  20. 40:19Synchronized Statement
  21. 41:42Macro Trick
  22. 45:07Synchronization
  23. 46:05Expression
  24. 46:25Two Arguments
  25. 50:56Facebook
  26. 54:01dot
  27. 56:17magic macro
  28. 56:27Synchronize
~/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.