Optimization of conditional access to globals: thread-unsafe?

Robert Dewar dewar@adacore.com
Sun Oct 28 17:26:00 GMT 2007


Erik Trulsson wrote:

> Unfortunately it seems that the POSIX standard for threads say that as long
> as access to a shared variable is protected by a mutex there is no need to
> use 'volatile'.

How does it say this, in some semantically precise way, or with hand
waving as in this sentence.
> 
> This means that POSIX essentially defines certain behaviours that the C
> standard left undefined.

But does it do so precisely?



More information about the Gcc mailing list