there are a bunch of fast memory barrier atomic ops in GCC linux like __sync_fetch_and_and etc.
I want to fetch and set a pointer value in memory so that it is guaranteed to be the value set when gotten as sometimes the assignment instructions are not atomic. I don't want a heavyweight mutex for this as it is too fat.
what is the best way ?