Hacker News new | ask | show | jobs
by Eiwatah4 4486 days ago
Either that, or a race condition.
2 comments

I'm not sure that's necessarily the case. See my comment above about sequential consistency.
Aren't those undefined behavior bugs?
Imagine two threads that safely lock a resource, increment it, copy the value, and then unlock it. This is entirely defined, but also a race condition.

Race conditions are a lot like unsanitized input. They don't cause problems by themselves, but if you make incorrect assumptions it's easy to write incorrect code.

It's data races specifically that are undefined behaviour.