~/talk

Tackling Contention: The Monsters Inside the 'sync.Locker'

Talkat GopherCon UK 2019 · 2019-08-21..08-23· [concurrency, go]
slides:none on file

Shows how pprof and the mutex profile expose that a simple increment loop spends >95% of time waiting on sync.Locker, and how trace regions pin down tail latency and scheduler wait time. Demonstrates splitting state into N shards and batching updates to cut contention by the number of shards, explores tradeoffs of replacing channels with mutexes, when sync.Map helps, and the pitfalls and hazards of switching to atomics, with real crash-causing examples.

AI-written summary · about

  1. 0:00Introduction
  2. 1:05Tools
  3. 7:31Measure
  4. 8:06Algorithm
  5. 9:06Channels
  6. 13:16Code
  7. 15:25Memory
  8. 18:18Map
  9. 21:22Shared Integral
  10. 23:29History
~/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.