Re: [go-nuts] thread safety of map when each goroutine access a different key

2017-03-13 Thread Albert Tedja
Great. Thanks! Looks like it's just better if I return a struct if these goroutines are operating independently anyway. On Monday, March 13, 2017 at 12:20:42 AM UTC-7, Konstantin Khomoutov wrote: > > On Sun, 12 Mar 2017 23:39:59 -0700 (PDT) > Albert Tedja > wrote: > > > I know map itself isn't

Re: [go-nuts] thread safety of map when each goroutine access a different key

2017-03-13 Thread Konstantin Khomoutov
On Sun, 12 Mar 2017 23:39:59 -0700 (PDT) Albert Tedja wrote: > I know map itself isn't threadsafe, but I am just wondering how > threadsafe it is if you can be absolutely sure that each goroutine > accesses a different key in the map. > Say, goroutine 1 accesses mymap["1"] > and goroutine 2 acces

[go-nuts] thread safety of map when each goroutine access a different key

2017-03-12 Thread Albert Tedja
Hello, I know map itself isn't threadsafe, but I am just wondering how threadsafe it is if you can be absolutely sure that each goroutine accesses a different key in the map. Say, goroutine 1 accesses mymap["1"] and goroutine 2 accesses mymap["2"] and so on. Thank you in advance. -- You recei