worker pool in golang - part 2

go dev.to

In Part 1 we built a worker pool: a jobs channel, three workers, a results channel, and a closer goroutine that calls wg.Wait() then close(results). We also walked into a deadlock on purpose, because that is how you learn to read a concurrent program. Part 1 was easy in one specific way: the workers never shared anything. Each worker read from a channel and wrote to a channel, and channels do the synchronization for you. Channels are Go's "share memory by communicating" answer. In this part we

Read Full Tutorial open_in_new
arrow_back Back to Tutorials