On Fri, Oct 13, 2017 at 11:05 AM, Alex Buchanan <buchanae.o...@gmail.com> wrote:
>
> Basically, I want to spawn a goroutine per object, objects have unique IDs,
> and I want each routine to write its results to a shared map. Nothing will
> be reading from the map while the goroutines are running.
>
> Is this safe?

No.  In general, multiple goroutines writing to a single variable is
not safe.  You need some sort of synchronization.

Ian

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to