Explain the use of the volatile data type?
Anonymous
Volatile is used when a data object might be accessed by more than 1 thread, or by a thread and one or more interrupts. It does this by ensuring any data access is via main memory, so that the cache cannot become inconsistent. In embedded systems it is typically used as a mechanism for an interrupt to signal that a timer, or external event, requires attention - e.g. a receive buffer has new data.
Check out your Company Bowl for anonymous work chats.