Why are globals set to tls by default? and why is fast code ugly by default?

Nick Treleaven nick at geany.org
Fri Mar 31 10:32:53 UTC 2023


On Sunday, 26 March 2023 at 20:36:37 UTC, ryuukk_ wrote:
> Golang doesn't even have thread local storage, yet they do very 
> well

Go doesn't have a solution to preventing data races at compile 
time, they just say don't share memory. But what if you 
accidentally share memory? That is *very* easy to do in Go. You 
and your users are out of luck. All you can do is run the race 
detector and pray that you happen to test all the code paths with 
it that might have data races:

> The race detector only finds races that happen at runtime, so 
> it can't find races in code paths that are not executed

https://go.dev/doc/articles/race_detector


More information about the Digitalmars-d-learn mailing list