Volatile (computer programming): Difference between revisions

Content deleted Content added
No edit summary
m cleanup stray letter
Line 1:
In [[computer programming]], a [[variable]] or object declared with the '''volatile''' [[Keyword (computer programming)|keyword]] may be modified externally from the declaring object. For example, a variable that might be concurrently modified by multiple [[Thread (computer science)|threads]] should be declared volatile. Variables declared to be volatile will not be optimized by the [[compiler]] because their value can change at any time. Note that operations on a volatile variable are still ''not'' [[Atomic operation|atomic]]. a
 
==What can happen if volatile is not used?==