Data races by code inspection

Data races by code inspection

I can see (most of the time) when the examples in the Programmer's Guides show a program's source code and claim that a certain variable has a race condition. Those are obvious.

However, is it generally easy to find data races by code inspection? Some of the ones that I find using the Cilk tool are not at all obvious. They are in fact quite dificult to see in the code.

So the question is are data races easy or had to detect by code inspection. I am sorry if the question is so general.


2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Sometimes they're pretty obvious. In simple examples (like the ones that ship with Cilk++), they tend to be plain as day. In larger projects with multiple modules, especially if you aren't as familiar with the code base, they aren't necessarily as obvious.

Leave a Comment

Please sign in to add a comment. Not a member? Join today