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: question on semantics



On May 4, 2005, at 10:59 AM, Chris Friesen wrote:
I'm not sure who I should address this to...I hope this is correct.

If I share memory between two processes, and protect access to the memory using standard locking (fcntl(), for instance), do I need to specify that the memory is volatile?

It is safer to. People might compile your whole app at once for better optimization, and the compiler might be just smart enough to optimize it away. This would be in conjunction with the compiler getting smarter about libc style functions, and what they read and write. Both of these can happen in the next 5 years in my book. Betting on the optimizer not getting smart, is a dangerous bet, better to just state what you want to do.



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