Optimization of conditional access to globals: thread-unsafe?
Tomash Brechko
tomash.brechko@gmail.com
Mon Oct 29 08:49:00 GMT 2007
On Mon, Oct 29, 2007 at 11:42:10 +0300, Tomash Brechko wrote:
> It means that the current thread is free to cache the value in the
> register as long as it knows no other thread can access it (i.e. as
> long as it holds corresponding mutex).
And because your next question will be "how the compiler will know the
corresponding mutex", the answer is: it can't, that's why "opaque
function" rules come to play.
--
Tomash Brechko
More information about the Gcc
mailing list