by cpgxiii · 3y ago · 0 comments
Parallelism introduces an additional class of bugs, but they are fundamentally addressed the same way as any other class of bugs - e.g. testing, tools, and code review. If some_one_ can unknowingly break a system, that means the tools and processes weren't good enough.
Also, the code introducing a race condition may get lucky when your CI system runs the tests and still make it into your main branch.
I agree that tooling (like static analysis, Rust's borrow-checker, etc) can play a big role here though.
Particularly for dynamic analysis, you need to have test cases that usefully cover the design behavior. E.g. if you design a component to be safely shared, you need tests that exercise that sharing where the static/dynamic analyzer(s) will identify unsafe sharing. Likewise, if you know something is unsafe, you should probably have tests that demonstrate that the static/dynamic analyzer(s) do detect the unsafe usage.