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]

Re: atomic operations


Vardhan, Sundara (GE Infra, Energy) wrote:


Are there any atomic operations available. I am looking for something equivalent to atomic_swap_uchar in Solaris. I tried to use __sync_val_compare_and_swap() but get errors when the program tries to load it in runtime. Perhaps I need to link or download some libraries. Any idea which?


I guess this is controversial, with wildly varying points of view. From my point of view, the built-in gcc support for atomic is what OpenMP provides. For the targets I know of where gcc implements OpenMP, I believe it's done via pthread_mutex.
You could check for the implementation of __sync_ buitins for your target:
http://gcc.gnu.org/onlinedocs/gcc-4.1.0/gcc/Atomic-Builtins.html



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