This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Dave Korn wrote:
On 29 October 2007 01:38, David Miller wrote:

You'll be back. Next week, you'll discover a corner case where caching a
shared variable in a register can be a bad thing when one thread uses locks
and the other doesn't, and you'll be back to demand that optimisation is
removed as well.
Why would David ask for something so unreasonable?

Why do you believe that the use of mutex to synchronize access to a shared resource, without the use of volatile on the shared resource being accessed, as documented in countless real life examples, is unreasonable or incorrect?

I do not understand your position.

Cheers,
mark

--
Mark Mielke <mark@mielke.cc>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]