Jump to content

Volatile (computer programming)

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Theinfo (talk | contribs) at 19:18, 30 August 2004 (new). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

In computer science, a variable or object declared with the volatile keyword may be modified externally from the declaring object. For example, a variable modified by multiple threads should be declared volatile.

Variables and objects declared as volatile will not be optimized by the compiler because their value can change at any time.