这里没有橄榄
15:37 · 2021年12月25日 · 周六
No Headback
为什么你不应该接受有 race 的代码
Telegraph
|
原文
Telegraph
为什么你不应该接受有 race 的代码 - No Headback
在任何语言的并发编程场景中,都有 race 问题,现代语言为了解决 race 问题有两种思路,一种是像 rust 那样的通过所有权+Sync/Send 限制用户尽量无法写出带 race 的代码;一种是像 Go 这样,通过 race detector 在测试期间检查数据竞争问题。 Go 的 race detector 设计决定了其无法在线上环境开启,而很多公司的项目上线前其实是没有 race test 的环节的,这就导致了一些 Gopher 认为我写出 race 的代码也没关系,因为可以“最终一致”。 在…
Home
Powered by
BroadcastChannel
&
Sepia