Java Volatile

preview_player
Показать описание
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

Java volatile tutorial - textual:

Java synchronized tutorial - textual / video:

Java concurrency tutorial - textual:

Java concurrency tutorial - playlist:
Рекомендации по теме
Комментарии
Автор

The favorite part of this series of videos are those clear diagrams. They make the internal things clear and comprehensive.

小说精选
Автор

Again, the best explanation I have ever seen about volatile keyword in Java. As clear and concise as it can be . No loopholes, no smart fancy tech words to confuse the meaning, but just a clear cut explanation. I have infact wrote down the key sentences from this video in my notes :) .

Once again you nailed it Jakob !

omnipoten
Автор

That was super clear.
As long as you deliver this concept very smoothly, then you understand it very well. which is very rare this days.

repotek
Автор

God of Concurency..i have bene flowing you since my 2014 when you used to write blog post only...by going through your post i attend interview like a LION when they ask mutithreading a Lot form 10+ yrs exp guy from BLR, India.

shubhamagarwal
Автор

Thank you so much for this video. I was always confused with volatile and this video has cleared all my doubts. True java champion!! Thanks

Abdullahkhan-kspy
Автор

Awesome demonstration and explanation Jakob!! Loved it!! keep up the good work!!

ajaygaulia
Автор

Brilliant explanation with simple and easy to understand examples. Thanks a lot!

jkwong
Автор

I always love your style to make all of things really simple

KamalNady-yu
Автор

Another very cool and informative video on Java volatile keyword functionality. Thank you so much for making and posting this video!!

farhadpagdiwala
Автор

Nice Explanations with a calm tone. Thank you.

susanwowe
Автор

This is an awesome video! Thank you so much for your detailed explanation. by far the clearest explanation I've seen on this topic.

alexwhb
Автор

I hit the like button and subscribed, so I hope new videos will come out before I finish those 22 videos. Thanks for those awesome videos, I really appreciate it

crazy-boy
Автор

Thank you so much for such a concise and clear presentation! Please keep uploading such a great content!

VLADICAKG
Автор

I agree with the other comments. Very clear and simple explanation. Thank you!

hectorrios
Автор

Great video and nicely explained.
One question though : When you say " all variables visible to thread at the time of volatile read/write",
When is a variable considered VISIBLE to a thread.

vincool
Автор

Nicely explained, very helpful video. Thank you Jakob.

nitinpandey
Автор

Hi Jakob, thank you so much for the amazing concurrency tutorial :) I have learned a lot from your course till now and still have about 17 lectures to go. I have a question/suggestion about the given example in this lecture. As I understand, Thread-1 is meant to execute the setter method and demonstrate the benefit of having the volatile variable "int val3" being written to at the end of the method "final instruction" and that this will force the program to write the other 2 variables to the main memory as well as val3. However, i think this example is mixing things a bit because in the setValues method, we are reading values in a different order from the order suggested in the getValues method. I'd like to know how do you see it from this point of view. Thanks in advance :)

ehabahmedyassen
Автор

Another Superb Video with wonderful knowledge shared in detailed way.
Thank you so much Jakob :)

theunusual
Автор

Really appreciate your tutorial.

seems the volatile is not for thread-safe, is it a better to use the synchronized (read/write) rather than the volatile?

bunthaideng
Автор

Jakob :) you've decided to start videos. :) Thank you. I like your blog about java, read about 3 articles. Wish you luck!

ffatheranderson