This is the mail archive of the
mailing list for the GCC project.
RE: Optimization of conditional access to globals: thread-unsafe?
On 28 October 2007 13:32, Bart Van Assche wrote:
> Requiring that all
> thread-shared variables should be declared volatile is completely
Any variable that may be altered by an external unpredictable asynchronous
'force majeure' must be declared volatile or the behaviour is undefined. Your
code is simply incorrect, and you appear to be demanding that the language
standards and the compiler all be revised to make the buggy code valid.
> We need a solution today for the combination of C/C++
> and POSIX threads, we can't wait for the respective language
> standardization committees to come up with a solution.
You already have it, but you have declared it "unacceptable" and refused to
use it without stating any clear reason.
Can't think of a witty .sigline today....