Re:Intro to images in Go – concurrency
by icebraining on Friday November 01, 2013 @02:11PM
(#6655338)
I'm a noob at concurrent programming, but from what I can tell, the only concurrent mutation is when setting the pixels, in image.go:
94 p.Pix[i+0] = c1.R
95 p.Pix[i+1] = c1.G
96 p.Pix[i+2] = c1.B
97 p.Pix[i+3] = c1.A
IIRC, copying a single byte is safe, so what could happen is that you could end up with weird pixels, if two nodes were setting the same pixel at the same time.
Obviously it can't be too much of a big deal, since the (very nifty) example works just fine, but I'm curious about what's going on here.