News for hackers. Stuff that matters.
Re:Benefits of named return values in Go by the8472 on Friday June 30, 2017 @08:05AM (#14670168)
How can you be sure that the other threads ever see it in time? they might be suspended for a whole second because a HDD needs to spin up or something like that.

So threads never seeing the value is already a valid outcome, so the compiler might as well always do that.

Re:Benefits of named return values in Go by heythere124 on Friday June 30, 2017 @08:18AM (#14670228)
time.Sleep(1000) could be replaced with a real syncing mechanism of some kind -- it's only for illustration.
Re:Benefits of named return values in Go by the8472 on Friday June 30, 2017 @12:46PM (#14671900)
a real syncing mechanism would introduce compiler barriers that prevent such an optimization.