MENU

Fun & Interesting

Java Volatile

Jakob Jenkov 50,431 lượt xem 4 years ago
Video Not Working? Fix It Now

The Java volatile keyword can be applied to Java variable declarations to force the Java VM to always read the variable value directly from main memory, and always write changes to the variable directly back to main memory immediately.

Chapters
0:00 Java volatile introduction
0:41 Non-volatile variable visibility problems
2:27 Java volatile visibility guarantee
5:30 Instruction reordering could break the Java volatile visibility guarantee
12:33 Java volatile happens before guarantee
15:03 Java volatile performance overhead
15:56 Java volatile is not always enough

Java Memory Model - JSR 133
https://www.cs.umd.edu/~pugh/java/memoryModel/jsr-133-faq.html

Java volatile tutorial - textual:
http://tutorials.jenkov.com/java-concurrency/volatile.html

Java synchronized tutorial - textual / video:
http://tutorials.jenkov.com/java-concurrency/synchronized.html
https://www.youtube.com/watch?v=eKWjfZ-TUdo

Java concurrency tutorial - textual:
http://tutorials.jenkov.com/java-concurrency/index.html

Java concurrency tutorial - playlist:
https://www.youtube.com/playlist?list=PLL8woMHwr36EDxjUoCzboZjedsnhLP1j4

Comment