User talk:Twirrim

From Rosetta Code

Mandelbrot set parallelisation

I've reverted your Mandelbrot_set#Go change.

If you build/run your version with Go's race detector you'll see it complains (correctly, the race detector can have false negatives but not false positives).

You modify the image in Go routines but you added no synchronization to know when it's done and safe to read the image data to write the output file. That could be easily to solved with a sync.WaitGroup or similar.

A more subtle issue is that image.Set makes no guarantee what-so-ever about concurrency safety. The current image.NRGBA implementation does appear to be safe.

At a minimum synchronization would need to be added.

dchapes (talk | contribs) 20:35, 22 August 2015 (UTC)