Posts

Showing posts with the label volatile

Java Keywords (Part XXII): volatile

Java keyword list abstract continue for new switch assert default goto * package synchronized boolean do if private this break double implements protected throw byte else import public throws case enum instanceof return transient catch extends int short try char final interface static void class finally long strictfp volatile const * float native super while Keyword marked with an asterisk (*) are keywords that, although valid, are not used by programmers. In the last article, we learned about the use of synchronized keyword, and we scratched the surface a little bit about concurrency. The keyword volatile is also relevant in concurrency. To learn more about why this keyword is applicable to concurrency, please read about Atomic Access . You could also read the Threads and Locks section of the Java Specification . As we learned before, the Java programming language allows threads to a