3 ms·
How does go not prevent data races? It has a race detector, channels, and atomics.
by jhawk28 12y ago
How does go not prevent data races? It has a race detector, channels, and atomics.
- bascule 12y agoYou can still send mutable state across channels, at which point it is shared and potentially racy. Race detectors only help you catch data races in the act (e.g. in production), they don't prevent them from happening in the first place. Wikipedia has a nice description: https://en.wikipedia.org/wiki/Go_(programming_language)#Race_condition_safety https://en.wikipedia.org/wiki/Go_(programming_language)#Race...