This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GCC Atomic Operations


Hello, 

I am using GCC Atomic operations, e.g. __sync_bool_compare_and_swap to
do some low level sync stuff. I have the following questions: 

1) are these SMP-safe on x86, i.e. will the result be visible to all
CPUs after applying these functions? 
2) otherwise, does it requires some sort of memory barrier/fence to
flush the result? 
3) do I have to use "volatile" with atomic operations? 


Thank you!







Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]