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: Heads-up: volatile and C++


Ken Raeburn wrote:

That's what I thought. So, unless the compiler (or language spec) is going to become thread-aware, any data to be shared across threads needs to be declared volatile, even if some other mechanism (like a mutex) is in use to do some synchronization. Which means performance would be poor for any such data.

The use of shared variables without synchronization is rare in any case in most code.

Which takes me back to: I think the compiler needs to be thread-aware. "Enhancing" the meaning of volatile, with the attendant performance issues, still doesn't seem adequate to allow for multithreaded programming, unless it's used *everywhere*, and performance shoots through the floor....

I don't see the point here, volatile is exactly intended to deal with this situation



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