Benign data races: what could possibly go wrong? | Intel® Developer Zone
Rohit Khare stashed this in potpourri
Stashed in: NOT GOOD
But consider we have such an "innocent" code as:
1: int op_count; 2: ... 3: op_count++; // Executed by several threads, it’s OK if it’s not 100% precise.
First, it’s undefined behavior according to C++ standard, C standard, POSIX, Go memory model and any other relevant combination of standards. The fact that the behavior is undefined means that it can lead to basically any runtime behavior, including accidental nuclear missile launch (see an example below).
Drive Through? Good.
All Three: NOT GOOD.