~/talk

Swimming pool semaphores

Talkat Devoxx Belgium 2019 · 2019-11-04..11-08· [go, concurrency]
slides:none on file

Shows two concrete semaphore patterns implemented as buffered channel tokens, including using a channel-as-shelf where initial items encode the counter and a token-take pattern, with a swimming-pool example limited to capacity 12. Adds practical features: timeout via select, cancellation, and atomic multi-token acquire. Demonstrates extensions to sync.WaitGroup and errgroup.Group to cap concurrency and avoid DB connection exhaustion, with ~50-line, ready-to-use code that compiles and is production-ready.

AI-written summary · about

  1. 0:00Swimming pool semaphores
  2. 3:58Implementing with Go channels
  3. 6:27Advanced use with timeouts
  4. 8:36Why semaphores matter
  5. 11:28Semaphores for correct concurrency
~/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.