[Interest] QThread
Thiago Macieira
thiago.macieira at intel.com
Mon Mar 24 19:01:57 CET 2014
Em seg 24 mar 2014, às 09:49:07, Bob Hood escreveu:
> I actually use the "volatile" tag to tell the compiler that it cannot
> optimize (i.e., make compile-time assumptions about) the variable that it
> decorates. Does std::atomic have the same meaning for optimizations? I
> can't get a clear picture of this by a (cursory) Google.
No, it doesn't.
It tells the *processor* (not the compiler) that it needs to go fetch the
value from memory.
> If compilers still consider std::atomic in aggressive optimizing, then it
> might be an either/or depending upon particular need.
--
Thiago Macieira - thiago.macieira (AT) intel.com
Software Architect - Intel Open Source Technology Center
More information about the Interest
mailing list