Before using CK, I resorted to fetch_and_and/fetch_and_or. It doesn't read as nicely, but the difference is probably negligible.
-
-
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
Why no asm blocks? Interested in compiler portability?
-
maybe
@preshing knows - 1 more reply
New conversation -
-
-
__sync_lock_test_and_set will do an xchg. That's the closest I know of! https://gcc.gnu.org/onlinedocs/gcc-4.2.0/gcc/Atomic-Builtins.html …
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
does std::atomic<T>::fetch_or do this under the hood?
-
It does a cmpxchg in a loop https://godbolt.org/g/cQPRUY
- 1 more reply
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.