~/talk

Unbound Concurrency in Go

Talkat GopherCon 2021 · 2021-12-05..12-08· [concurrency]
slides:none on file

Builds a TCP port scanner using Go's standard library, starting from a single hardcoded dial to net.Dial and evolving through parallel scans to a worker pool that defaults workers to GOMAXPROCS, buffered channels as a job queue, and sync coordination via sync.WaitGroup. It demonstrates finding port 5432 open, hits the OS "too many open files" limit when naively spawning thousands of goroutines, and shows fixes: bounded workers, a semaphore from golang.org/x/sync/semaphore, and pipeline/fan‑out fan‑in patterns; examples run successfully.

AI-written summary · about

  1. 0:00Go concurrency and port scanning
  2. 3:10Port scanner and Go's role
  3. 7:46Sequential port scanning
  4. 9:12Why sequential scanning is inefficient
  5. 10:16Goroutines without sync
  6. 12:03Why goroutines need sync
  7. 13:05sync.WaitGroup introduction
  8. 18:25First concurrent scanner with WaitGroup
  9. 19:50Unbounded concurrency risks
  10. 21:13Worker pool to limit concurrency
  11. 24:06Buffered channels for work
  12. 26:13Directional channels and safety
  13. 28:42Worker pool walkthrough
  14. 32:16Testing the worker pool
  15. 32:36Semaphores for batch processing
  16. 37:36Pipelines for data processing
  17. 38:37Port scanning pipeline
  18. 41:27Fan-out and fan-in
  19. 45:06Final pipeline implementation
  20. 46:10Context and cancellation
  21. 50:03Error filtering in pipelines
  22. 51:52Testing error handling
  23. 53:55Key takeaways
~/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.