013: Go's concurrency to the rescue
Real-world story about how Go's concurrency save a .NET performance issue I was having where I needed to call a process that takes 5 to 15 seconds to complete 6m times.
Go's worker queue pattern:
type WorderPool struct {
queue chan int
}
func (wp *WorkerPool) start() {
for i := 0; i < 500; i++ {
go funcIO {
for id := range wp.queue {
doSomething(id)
}
}()
}
}
func (wp *WorkerPool) add(id int) {
wp.queue <- id
}
type WorderPool struct {
queue chan int
}
func (wp *WorkerPool) start() {
for i := 0; i < 500; i++ {
go funcIO {
for id := range wp.queue {
doSomething(id)
}
}()
}
}
func (wp *WorkerPool) add(id int) {
wp.queue <- id
}
Best way to show support for the pod is by sharing it around and buying my course.
Creators and Guests
![Dominic St-Pierre](https://img.transistor.fm/HCtTIm4fjr-PPNKVTdewmxYFfFJgSQJkWYmXjb1QLug/rs:fill:400:400:1/q:60/aHR0cHM6Ly9pbWct/dXBsb2FkLXByb2R1/Y3Rpb24udHJhbnNp/c3Rvci5mbS9wZXJz/b24vZjIxMjQyNjAt/NDMwMy00ZWYzLWIz/MDQtMGU0ZTMxNjZl/ZGQ5LzE3MDcxNDYy/MzYtaW1hZ2UuanBn.webp)
Host
Dominic St-Pierre
Go system builder - entrepreneur. I've been writing software systems since 2001. I love SaaS, building since 2008.
![013: Go's concurrency to the rescue](https://img.transistor.fm/bF6iLV4xtxdYH5mX8t_vf_A5r7knvK8pvJT3yTiumtQ/rs:fill:800:800:1/q:60/aHR0cHM6Ly9pbWct/dXBsb2FkLXByb2R1/Y3Rpb24udHJhbnNp/c3Rvci5mbS9zaG93/LzI3MjkyLzE2NDE1/NjU2MDgtYXJ0d29y/ay5qcGc.webp)