The Volatile Keyword
Metadata
- Author: EmbeddedRelated.com Blogs
- Full Title: The Volatile Keyword
- Category: #articles
- URL: The Volatile Keyword
Highlights
- When you declare a variable/object volatile, you are telling the compiler not to optimize access to the data. When your code writes a value to the variable, it should be written straight away and not saved in a register for use later. Likewise, when the code reads the value, it should not use a copy that was obtained earlier. (View Highlight)