Volatile (computer programming)

This is an old revision of this page, as edited by Neilc (talk | contribs) at 05:46, 22 June 2005. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

In computer programming, a variable or object declared with the volatile keyword may be modified externally from the declaring object. For example, a variable that might be concurrently modified by multiple threads (without locks or a similar form of mutual exclusion) should be declared volatile. Variables declared to be volatile will not be optimized by the compiler because their value can change at any time.