This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: can __exchange_and_add be used from outside?
- From: Ian Lance Taylor <iant at google dot com>
- To: Juan Carlos Franzoy <jfranzoy at yahoo dot com dot ar>
- Cc: gcc-help at gcc dot gnu dot org
- Date: 27 Mar 2007 06:12:02 -0700
- Subject: Re: can __exchange_and_add be used from outside?
- References: <3426.14943.qm@web32709.mail.mud.yahoo.com>
Juan Carlos Franzoy <jfranzoy@yahoo.com.ar> writes:
> Hello. I write because I was wondering if __exchange_and_add can be used from user code or it's an internal detail of libstdc++.
>
> I have to implement a library with AtomicSet and AtomicAdd. The library must be portable across solaris/sparc, linux/x86 and hpux11/parisc.
>
> If the answer is no, do anybody know how to do it?
gcc provides these calls as extensions:
http://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc/Atomic-Builtins.html
Ian