News for hackers. Stuff that matters.
Re:No sane compiler would optimize atomics (2015) by kllrnohj on Sunday July 11, 2021 @10:33PM (#27806334)
If you're going to use atomics, you should be reading what guarantees those atomics actually provide. In this case of memory_order_relaxed they pretty clearly specify they don't provide any cross-thread synchronization. So if you wrote those 4 atomics expecting something the docs explicitly & clearly say it doesn't provide, that's pretty much entirely your fault and not "language lawyering"

There are no comments on this comment yet.