Usage of volatile specifier in C/C++/Java
问题 While going through many resources on multithreaded programming, reference to volatile specifier usually comes up. It is clear that usage of this keyword is not a reliable way to achieve synchronization between multiple threads atleast in C/C++ and Java (versions 1.4 and earlier). Here is what wikipedia lists (without explaining how) as typical usages this specifier:- allow access to memory mapped devices allow uses of variables between setjmp and longjmp allow uses of variables in signal