On Sun, 26 May 2019 07:03:35 -0700 (PDT) Sotirios Mantziaris <smantzia...@gmail.com> wrote:
> Let's assume that the string field Name has the value `Mr. Smith` and we > change this to `Mr. Anderson` in the goroutine, what are the possible > values that i could bet on a read? > If these are either `Mr. Smith` or `Mr. Anderson` i am very ok with that > because i want the value to be eventually consistent. If there is another > possible outcome then i need to synchronize the access and refactor a lot. [1] There is no such thing as a benign data race. Now you use string, down the line someone will 'optimize' code with []byte and suddenly you may read `Mr. Smitrson` as well. Also, for raced parts of the structure, you inevitably will end with `Mr. Anderson` having Mr. Smith's salary and Mr. Smith having coat color of Ms. Brown's dog. Hope that below lecture will help [1] https://software.intel.com/en-us/blogs/2013/01/06/benign-data-races-what-could-possibly-go-wrong -- Wojciech S. Czarnecki << ^oo^ >> OHIR-RIPE -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/20190526172320.2da44b0b%40zuzia. For more options, visit https://groups.google.com/d/optout.