Phase
Concurrency Fundamentals
Goroutines, WaitGroups, races, mutexes, channels, worker pools, context, and graceful shutdown — the foundations every concurrent AI pipeline needs.
9 published · 0 upcoming
- Part 1Published
From Sequential Scripts to Concurrent AI Pipelines in Go — Part 1
Why Sequential AI Pipelines Stop Scaling
- Part 2Published
From Sequential Scripts to Concurrent AI Pipelines in Go — Part 2
We add goroutines to the pipeline and hit three problems in a row: a silently discarded goroutine, a loop-capture trap, and a real data race — ending with a working but unsafe concurrent system.
- Part 3Published
From Sequential Scripts to Concurrent AI Pipelines in Go — Part 3
We fix the data race from Part 2 with a mutex — then prove, with real numbers, that locking in the wrong place quietly destroys every gain concurrency gave us.
- Part 4Published
From Sequential Scripts to Concurrent AI Pipelines in Go — Part 4
Deadlocks are the silent failures of concurrent systems — no panic, no stack trace, just a process that stops making progress. We create three intentionally, read the runtime messages Go gives us, and build rules that prevent them.
- Part 5Published
From Sequential Scripts to Concurrent AI Pipelines in Go — Part 5
We replace the mutex with a channel. No shared memory, no lock, same speed — and a look at why "share memory by communicating" is more than a slogan.
- Part 6Published
From Sequential Scripts to Concurrent AI Pipelines in Go — Part 6
Unbuffered channels force synchronisation between sender and receiver. Buffered channels decouple them. And select — introduced here in the collector — lets you wait on multiple channels at once and proceed with whichever fires first.
- Part 7Published
From Sequential Scripts to Concurrent AI Pipelines in Go — Part 7
One goroutine per article does not scale to production traffic. We build a fixed-size worker pool and measure exactly how worker count trades off against throughput.
- Part 8Published
From Sequential Scripts to Concurrent AI Pipelines in Go — Part 8
Every external call in a concurrent AI pipeline needs a deadline. We add context.WithTimeout to the worker pool and see, with real numbers, what happens when we do — and when we forget.
- Part 9Published
From Sequential Scripts to Concurrent AI Pipelines in Go — Part 9
A pipeline that can not be stopped cleanly is not production-ready. We add OS signal handling, propagate cancellation through the worker pool, and build a ShutdownReport that accounts for every article — even under an abrupt stop.