3 ms·
For the record, Go has no static thread safety guaranty. It's easy to write a data-race in Go (and it occurs frequently). Fortunately the go compiler has a tool
by stymaar 10y ago
For the record, Go has no static thread safety guaranty. It's easy to write a data-race in Go (and it occurs frequently). Fortunately the go compiler has a tool that help detecting data-races[1]. The only two languages I know that offer data-race-free multi-threading are Pony[2] and Rust.
Additionally, Go isn't really a C++ competitor: you'll probably never see Google Chrome using Go instead of C++. Go is a good language for back-end micro-services and cli tools, not for building performance-sensitive native desktop applications.
[1]: https://golang.org/doc/articles/race_detector.html https://golang.org/doc/articles/race_detector.html
[2]: http://www.ponylang.org/ http://www.ponylang.org/
- hellofunk 10y agoCorrect, the point of my post is that Go does not have these guarantees even though it is one of the few (only?) languages based on a methodology that actually has a proven theorem for statically guaranteeing thread safety; yes, that was never implemented in Go despite that all the other aspects of the methodology were. Which I just find interesting.
- masklinn 10y ago> The only two languages I know that offer data-race-free multi-threading are Pony[2] and Rust. I believe Erlang also does for the most part, though some of its built-in constructs are racey (the process registry if you query it, shared ETS tables, and dirty Mnesia operations).
- stymaar 10y ago> The only two languages I know that offer data-race-free multi-threading are Pony[2] and Rust. I should have added «with shared memory», otherwise any language that purely rely on message-passing is also free from data-races (even JavaScript is), but it lacks this important feature.