Hello, Once you have written out your values to the map, you can read them concurrently and safely. If you need to write again to it (insert or delete), then you must ensure it is done safely.
Note that, from what I can see in tip, in 1.9 there will be a safe concurrent map: https://tip.golang.org/pkg/sync/#Map. Le mardi 16 mai 2017 07:10:56 UTC+2, Yan Tang a écrit : > > Hi, > > I am aware of golang map is not safe for concurrent access, especially > when there is at least one writer. > > However, I want to know that if the map has been pre-populated, and > different coroutines access (read/write) different key/value pair, is it > safe to do so? There is no deletion or adding keys after the > initialization. > > I think it should be safe (having been doing this in C++ quite frequently) > but just want to double check. Thanks. > > Yan > -- 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.