~/talk

Unbounded Concurrency in Go

Talkat Craft Conference 2021 · 2021-06-02..06-04· [go, concurrency]
slides:none on file

Progressively builds a TCP port scanner in golang that starts with net.Dial to test single ports, scales to a loop over ~300 ports, and then goes concurrent with goroutines where unbounded launches hit “too many open files” errors. Fixes include sync.WaitGroup for waiting, a CPU‑sized worker pool, a semaphore from x/sync/semaphore (example uses max weight 100000 acquire 100 which gates ~1,000 goroutines), per‑port contexts with timeouts, and a pipeline with fan‑out/fan‑in and a done channel; the final tools work and avoid resource exhaustion.

AI-written summary · about

  1. 0:00Intro
  2. 0:37Overview
  3. 2:42Code
  4. 8:34Sync Package
  5. 11:51Worker Pool
  6. 15:56semaphore
  7. 21:15pipeline
  8. 27:36merge
  9. 35:56Wrap up
  10. 36:26Livestream
  11. 37:42Concurrency Recommendations
  12. 40:10Concurrency Tips
  13. 43:19Channels
  14. 44:40Tools
~/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.