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: Question on GCC 4.8 atomics


On 04/05/2013 12:39 PM, Bjorn Lindgren wrote:
> I would like to know if the built-in __atomic_* function calls are always 
> garanteed to succeed? If for example multiple threads on different 
> sockets/cores call the __atomic function on a globaly shared variable at 
> same time, are the calls then queued and executed?

I can't tell exactly what this question means.  I think you're asking if,
for example, an atomic_fetch-and-modify might fail to modify its target.
The answer is no: while the cmpxchg fails it will retry.

Andrew.


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