I have a dummy question about atomic variables using gcc.
My machine supports __sync_add_and_fetch function; I use this call in thread A to set my_variable (int) .
I want Thread B reading ...
This is related to this question.
rmmh's claim on that question was that on certain architectures, no special magic is needed to implement atomic get and set. Specifically, in this ...
The memcpy that comes with glibc is optimized. But it is by far not guaranteed to copy exactly one integer at a time at all times. It is also frequently inlined (as an intrinsic) by the compiler, so it is not even a call to the source of memcpy in the first place. If you want guarantees that the copy is ...