Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

FWIW, and this depends on the language obviously, but formal memory models typically do forbid races between atomic and non-atomic accesses to the same memory location.

While what you were doing may have been fine given your context, if you're targeting e.g. standard C++, you really shouldn't be doing it (it's UB). You can usually get the same result with relaxed atomic load/store.

(As far as AI is concerned, I do agree that the model should just have followed your direction though.)



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: