Re: Optimization of conditional access to globals: thread-unsafe?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> From: "Dave Korn" <dave.korn@xxxxxxxxxx>
> Date: Mon, 29 Oct 2007 01:16:07 -0000
> 
> >   Thing is, if you disable all optimisations that are potentially
> > unsafe in the presence of threads, won't you just get the same
> > effect as if you had used volatile anyway, only on every single
> > variable in the program instead of just the ones the programmer has
> > designated as sensitive?
> 
> This is not really what is being suggested at all.
> 
> The compiler simply cannot speculatively load or store to variables
> with global visibility.

Any optimization is good, and GCC's is great, though debugging it is hell,
and I do not see the problem with an option to turn off somebody's pet
feature when I need to.

It really is up to the programmer to decide how the program behaves, not a 
standards committee.

Just my 0.02, again.

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux