Benign Data Races: What Could Possibly Go Wrong? Share your comment!

A data race occurs when two threads access the same variable concurrently and at least one of the accesses is a write. Data races are one of the most common and hardest to debug types of bugs in concurrent systems. Data races on complex data structures (like strings and hash maps) are undoubtedly harmful and can lead crashes and memory corruption.

But what about “Benign” data races. Are they actually harmful? How do you suppress them?

Consider this “innocent” code:

1
int op_count;
2
...
3
op_count++;  // Executed by several threads, it’s OK if it’s not 100% precise.

To learn what could go wrong and what you can do, read the rest of the post here…

Posted on by Dmitry Vyukov, Intel®
0 comments
Sort: Newest | Oldest