Golang, Performance, Programming.
} c := make(chan px) var w sync.WaitGroup for n := 0; n < numWorkers; n++ { w.Add(1) go func() { for px := range c { m.Set(px.x, px.y, pixel(px.x, px.y, width, height)) } w.Done() }() } for i := 0; i < width; i++ { for j := 0; j < height; j++ { c <- px{i, j} } } close(c) w.Wait() return m } We have