~/talk

An Adventure in Race Conditions

Talkat ACCU 2019 · 2019-04-10..04-13· [concurrency]
slides:none on file

A proprietary image recompressor that handled ~620k slices/day and nine hours of work starts missing its SLA when input size doubles; initial per-stripe threads hit up to 1 second thread spawn cost and heavy oversubscription, plus subtle races: atomics used without mutexes break condition_variable wakeups, destroying the CV while tasks still run causes crashes, and early-exit locals are dangled. Fixes are moving the CV, requiring modification under the mutex, using a shared process context with weak_ptr→shared_ptr locking, and switching to a thread pool (16 stripes per machine) and futures (stlab) to reduce latency variance, though memory bandwidth becomes the ultimate limiter.

AI-written summary · about

  1. 0:00Start
  2. 5:52Synchronization Primitives
  3. 6:13Undefined Behavior
  4. 10:40Beware of Your Compiler
  5. 16:39Thread Pool
  6. 31:35Error Handling
  7. 35:42Process Context
  8. 38:11Conclusion
  9. 58:06Strategy
~/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.