View Single Post
  #2 (permalink)  
Old 04-18-2007, 12:17 PM
goldhouse goldhouse is offline
Senior Member
 
Join Date: Mar 2007
Posts: 136
goldhouse is on a distinguished road
The volatile keyword is used on variables that may be modified simultaneously by other threads. This warns the compiler to fetch them fresh each time, rather than caching them in registers. This also inhibits certain optimisations that assume no other thread will change the values unexpectedly. Since other threads cannot see local variables, there is never any need to mark local variables volatile.
Reply With Quote