Content deleted Content added
m "External links" is plural as there are more than one. Fixed using AWB |
|||
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 [[
==What can happen if volatile is not used?==
The following piece of [[
<pre><nowiki>
Line 18:
In this example, the code sets the value stored at [[memory address|___location]] 100 in the computer system to 0. It then starts to poll the address until it changes to 255.
An [[
<pre><nowiki>
Line 52:
With this modification the code will remain as it is and the CPU will detect the change when it occurs.
==External
*[http://www.programmersheaven.com/articles/pathak/article1.htm Use of volatile at Programmer's Heaven]
*[http://msdn2.microsoft.com/en-us/library/12a04hfd.aspx volatile keyword in Visual C++]
|