3 ms·
That causes concurrency issues, but that is not what is commonly understood by memory safety. With that said, Go indeed gives you plenty of rope to hang yourse
by kaba0 3y ago
That causes concurrency issues, but that is not what is commonly understood by memory safety.
With that said, Go indeed gives you plenty of rope to hang yourself with in relation to concurrency (among others).
- skitter 3y agoTechnically, there's memory unsafe memory sharing: Interfaces and slices are mutable and consist of multiple word that are accessed without synchronization, sharing a reference to a interface or slice between goroutines means you can get a mismatch between vtable ptr/data ptr or data ptr/length.
- kaba0 3y agoThat is again, language-dependent. Java for example can memory-safely have data races, even those that tear (what you are referring to here). Not the standard, but OpenJDK itself also has a guarantee that every value that any thread could observe was actually set by some other thread, so on incrementing a number from 0 from multiple threads you can never get -37, but for surely can observe an older value.