How to Go Wrong with Concurrency
summary
Go programs break when ownership and stop semantics are vague: channels block on full buffers so a slow consumer leaves senders stuck and goroutines leaked; sending pointers through channels shares mutable state and causes races unless copy-on-send is enforced; context cancellation doesn't terminate goroutines β it only signals, so cancel alone often leaves workers running. Demo is a file-reader pipeline that stalls on a 30-block burst and never recovers; fixes shown are bounded buffers, explicit drain/close protocols and choosing one clear ownership/stop pattern.
AI-written summary Β· about
chapters (9)
- 0:00Introduction to concurrency pitfalls
- 2:13Common concurrency mistakes
- 5:47Race conditions in buffers
- 9:23Pointer misuse in concurrency
- 12:56Stopping concurrency issues
- 17:42File processing and concurrency
- 21:49Document handling in concurrency
- 25:21Exception handling in concurrency
- 28:59Monitoring concurrency problems
